Merge lp:~james-page/juju-deployer/fixup-to-for-strings into lp:juju-deployer/darwin

Proposed by James Page
Status: Merged
Approved by: Kapil Thangavelu
Approved revision: 118
Merge reported by: Kapil Thangavelu
Merged at revision: not available
Proposed branch: lp:~james-page/juju-deployer/fixup-to-for-strings
Merge into: lp:juju-deployer/darwin
Diff against target: 21 lines (+2/-2)
1 file modified
deployer/env/base.py (+2/-2)
To merge this branch: bzr merge lp:~james-page/juju-deployer/fixup-to-for-strings
Reviewer Review Type Date Requested Status
Kapil Thangavelu Approve
Adam Gandelman Pending
Review via email: mp+188296@code.launchpad.net

This proposal supersedes a proposal from 2013-09-30.

Description of the change

Support use of string based machine identifiers in force-machine and
terminate-machine calls

To post a comment you must log in.
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

merged with minor change around the condition as it wouldn't work with mid = '0'. instead two separate clauses of the condition one with (mid.isdigit() and int(mid) == 0) to preserve original intent/behavior.

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 2013-09-13 13:36:22 +0000
3+++ deployer/env/base.py 2013-09-30 10:52:29 +0000
4@@ -82,7 +82,7 @@
5 repo = "."
6 params.extend(["--repository=%s" % repo])
7 if force_machine is not None:
8- params.extend(["--to=%d" % force_machine])
9+ params.extend(["--to=%s" % force_machine])
10
11 params.extend([charm_url, name])
12 self._check_call(
13@@ -96,7 +96,7 @@
14 delete the machine (ie units have finished executing stop hooks and are
15 removed)
16 """
17- if int(mid) == 0:
18+ if isinstance(mid, int) and int(mid) == 0:
19 raise RuntimeError("Can't terminate machine 0")
20 params = self._named_env(["juju", "terminate-machine"])
21 params.append(mid)

Subscribers

People subscribed via source and target branches

to all changes: