[placement][ptg] code refactoring constraints and goals
openstack at fried.cc
Thu Apr 11 16:54:37 UTC 2019
I was actually starting to explore
>> This suggests a change whereby we move a bunch of module-level methods
>> to instance methods. I actually really like that idea. So for example:
>> def _set_traits(context, rp, traits):
>> class ResourceProvider(object):
>> def _set_traits(self, traits):
>> # the artist formerly known as 'rp' is now 'self'
>> # and context is self._context
> For a variety of reasons, most of which would be obvious given my previous enthusiasm for exploring alternatives, I’ve proposed a story for refactoring out the DB-specific code from the rest of placement:
> I don’t know what everyone’s preference would be for where the DB code would go: either in private methods of the original module, or in a separate DB module, so I added as the first task coming to a decision on how to make that split.
, planning to propose them both as parallel changes/series so we could
see how they look IRL.
In the process, I discovered a remaining @classmethod in
resource_provider.py, which I figured should be taken care of first, so
I moved it.
And then looked for other @classmethodZ, because.
And ended up with , which removes all @classmethodZ from the project,
in keeping with what seems to be the majority's desire.
I'm going to fork another response to this thread to report on some
stuff I discovered on the original two proposals...
More information about the openstack-discuss