Merge lp:~hazmat/pyjuju/provider-determines-placement into lp:pyjuju
Proposed by
Kapil Thangavelu
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Gustavo Niemeyer | ||||
Approved revision: | 388 | ||||
Merged at revision: | 362 | ||||
Proposed branch: | lp:~hazmat/pyjuju/provider-determines-placement | ||||
Merge into: | lp:pyjuju | ||||
Prerequisite: | lp:~hazmat/pyjuju/local-unit-deploy | ||||
Diff against target: | 0 lines | ||||
To merge this branch: | bzr merge lp:~hazmat/pyjuju/provider-determines-placement | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gustavo Niemeyer | Approve | ||
Jim Baker | Pending | ||
Review via email: mp+76305@code.launchpad.net |
Description of the change
Machine providers need to define placement policy
Some provider only support particular placement policies, local
development in particular only supports the local placement policy.
This branch defers policy selection to the provider with input
of the user placement selection and defaulting if none provided
to the environment placement, and if finally to unassigned.
To post a comment you must log in.
Looks good, with one detail:
[1]
183 + def get_placement_ policy( self, preference):
184 + """Get the unit placement policy for the provider.
185 +
186 + :param preference: A user specified plcaement policy preference
187 + """
188 + if preference:
189 + return preference
The argument there is pretty weird. If there's a preference that overrules the
provider choice entirely, why calling the provider at all? Let's just drop the
argument and do the usual "if preference is None:" at the call sites.