[Pulp-list] "clean()" methods
jortel at redhat.com
Wed Mar 2 17:02:33 UTC 2011
On 03/01/2011 01:28 PM, Jay Dobies wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> On 03/01/2011 02:26 PM, Jay Dobies wrote:
>> We have them in BaseAPI to delete all collections the API is tied to.
>> Anyone mind if I start to move those to the model objects themselves?
>> Conceptually it makes more sense in a unit test to say "Consumer -
>> delete all of those between tests."
> Changed my mind. Turns out the clean() method is as simple as
> collection.remove(). I had seen elsewhere to iterate over each
> collection calling remove and that's the functionality I wanted to
> migrate. But if it's that simple, no need to clog up the model with the
> simple chain down to the collection method.
The clean() method is overridden in RepoApi essentially to delete the repo content on the
filesystem. We may have other cases like this.
> - --
> Jay Dobies
> RHCE# 805008743336126
> Freenode: jdob
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.14 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
> -----END PGP SIGNATURE-----
> Pulp-list mailing list
> Pulp-list at redhat.com
More information about the Pulp-list