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
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.
380. By Kapil Thangavelu

fix test typo

381. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

382. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

383. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

384. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

385. By Kapil Thangavelu

merge pipeline and resolve conflict

386. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

387. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

388. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

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.

review: Approve
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

Excerpts from Gustavo Niemeyer's message of Fri Sep 23 14:36:38 UTC 2011:
> Review: Approve
>
> 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.

The whole point of the inversion, is that the provider has the ultimate choice
as to the placement.

The user can express a preference via the cli or config, but not all providers
support all placement policies. ie. the local provider only works with the local
policy, where as providers like ec2 can utilize whichever preference the user
has selected.

Also delegation of policy choice to the environment config is done by the
this method, the passed preference here is just the cli value.

-kapil

389. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

390. By Kapil Thangavelu

merge machine-with-type and resolve conflict

391. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

392. By Kapil Thangavelu

add an error for invalid placement policies

393. By Kapil Thangavelu

add provider type to error message

394. By Kapil Thangavelu

more descriptive error messages in pick, use a generic in place unit

395. By Kapil Thangavelu

redo placement policies, providers define which policies they support the cli interaction picks, intersecting with user preference

396. By Kapil Thangavelu

Merged local-unit-deploy into provider-determines-placement.

397. By Kapil Thangavelu

revert pick_policy, provider determines placement

398. By Kapil Thangavelu

yank placement cli parameter per gustavo's suggestion.

399. By Kapil Thangavelu

raise a providererror if the environment placement policy is not supported by the local provider

Preview Diff

Empty

Subscribers

People subscribed via source and target branches

to status/vote changes: