-
Notifications
You must be signed in to change notification settings - Fork 168
Convert the distributor manager to mongoengine friendly controller. #2233
Conversation
@@ -169,7 +168,7 @@ def setUp(self): | |||
self.alias = (self.parentfs, self.parentfs) | |||
Consumer.get_collection().remove() | |||
Bind.get_collection().remove() | |||
RepoDistributor.get_collection().remove() | |||
model.Distributor.drop_collection() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does dropping the collection also remove indicies? If so, then sticking with a remove call would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe dropping the collection does remove the indices as well.
""" | ||
try: | ||
distributor_manager = manager_factory.repo_distributor_manager() | ||
distributor_manager.set_distributor_scratchpad(self.repo_id, self.distributor_id, value) | ||
qs = model.Distributor.objects.get_or_404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth noting that the except
statement below will catch the MissingResource
exception and turn it into whatever a DistributorConduitException
is. :( You've preserved previous behavior, which is totally fine, but I thought I'd at least point it out that the result of calling get_or_404
is being diminished.
@mhrivnak thanks for the super fast review! |
ok test |
Replaces the old RepoDistributor model and all its uses with new model, pulp.server.db.model.Distributor. Also replaces all instances of using pymongo to access the the distributors collection with mongoengine. closes pulp#780
Convert the distributor manager to mongoengine friendly controller.
Replaces the old RepoDistributor model and all its uses with new model,
pulp.server.db.model.Distributor. Also replaces all instances of using
pymongo to access the the distributors collection with mongoengine.
https://pulp.plan.io/issues/780