DRY pool meta-controllers
Bug #1351462 reported by
Kurt Griffiths
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zaqar |
Fix Released
|
Medium
|
Rose Ames |
Bug Description
Lots of duplicated code in the pool meta-controllers that RouterControlle
no longer affects: | zaqar/kilo |
Changed in zaqar: | |
milestone: | none → kilo-1 |
Changed in zaqar: | |
milestone: | kilo-1 → kilo-2 |
Changed in zaqar: | |
status: | In Progress → Fix Committed |
Changed in zaqar: | |
status: | Fix Committed → Fix Released |
Changed in zaqar: | |
milestone: | kilo-1 → 2015.1.0 |
To post a comment you must log in.
I see two issues with __getattr__.
First, a lot of the controller methods take positional arguments other than queue, and then convert them to keyword arguments for the control method. Second, they have varying behaviour when lookup fails (some raise an error, others return None or an empty list or whatever).
I have a feeling that handling all that with __getattr__ would be pretty ugly. Would it make more sense to just eliminate the target = self._lookup lines with a utility method or a decorator?