[Pulp-list] "clean()" methods

Jeff Ortel 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
> http://pulpproject.org
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.14 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNbUjYAAoJEOMmcTqOSQHCJdoIAIAwRfaYulzZD/zK8bDgtLM6
> Nnn+ZCYB1Q0Kx6Q/TTeQwqEpyuPbvYbYwgjH5j2PkCYdToYCD0BhhIY56X0Unnc1
> vQ88KACcVcQWwbxs+P7SA7mocojAz+xOKKleIlDfukfXUojaKVq2TB8noQbofOQF
> vUMvBg8SAz3Jlmp1eH8DF7O5lJEu1gDoS9j24p9i6gwaivbLjxn81X/dLkA6LAvP
> 1ViWKgRrwsAIeOIy68AprRmRLj8lpvkOqp/MmV20BrSD01+pRupwordgnYiZMmFg
> xFfJCB+RUu/9SyWPZRy0wXz/UQ8uTWs9QQYvGe5GBV3PlszIlw7LmJ6qzpVIBoA=
> =sSig
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Pulp-list mailing list
> Pulp-list at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list




More information about the Pulp-list mailing list