Code review comment for lp:~ltrager/maas/power_for_rackcontrollers

Revision history for this message
Lee Trager (ltrager) wrote :

I've moved all power commands to two new mixin classes, PowerMixin, and PowersMixin. Like the API endpoints the singular is used for individual object endpoints while the plural is for endpoints of multiple objects. Power commands now only show up for machines and rack-controllers but could be easily added to other node types.

I came across a bug in OperationsHandlerType where only methods defined in an
endpoints class, or its direct parent, would be automatically added to its exports list. Blake ran into the same bug when writing OwnerDataMixin. Since that mixin only has one method he redefined set_owner_data and called super(). As PowerMixin has a number of methods I modified support.py to add exportable methods from any base class, which are not defined as None in the child class, to the exports list. As this fixed the problem Blake was seeing I removed the set_owner_data methods which were just calling super().

« Back to merge proposal