Merge lp:~tvansteenburgh/juju-deployer/1478256 into lp:juju-deployer

Proposed by Tim Van Steenburgh
Status: Merged
Merged at revision: 149
Proposed branch: lp:~tvansteenburgh/juju-deployer/1478256
Merge into: lp:juju-deployer
Diff against target: 16 lines (+6/-0)
1 file modified
deployer/env/base.py (+6/-0)
To merge this branch: bzr merge lp:~tvansteenburgh/juju-deployer/1478256
Reviewer Review Type Date Requested Status
Marco Ceppi (community) Approve
juju-deployers Pending
Review via email: mp+266128@code.launchpad.net

Description of the change

Support constraints defined as a list or dict, so any of these will work:

constraints: key=val

constraints:
  - key=val

constraints:
  key: val

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'deployer/env/base.py'
2--- deployer/env/base.py 2015-06-18 08:34:12 +0000
3+++ deployer/env/base.py 2015-07-28 16:16:39 +0000
4@@ -86,6 +86,12 @@
5 fh.flush()
6 params.extend(["--config", fh.name])
7 if constraints:
8+ if isinstance(constraints, list):
9+ constraints = ' '.join(constraints)
10+ if isinstance(constraints, dict):
11+ constraints = ' '.join([
12+ '{}={}'.format(k, v) for k, v in constraints.items()
13+ ])
14 params.extend(['--constraints', constraints])
15 if num_units not in (1, None):
16 params.extend(["--num-units", str(num_units)])

Subscribers

People subscribed via source and target branches