Merge ~johnsca/juju-wait:bug/retry-config into juju-wait:master

Proposed by Cory Johns on 2017-07-12
Status: Merged
Merged at revision: 54eaa50674b6d38536f42634231a552c55d99263
Proposed branch: ~johnsca/juju-wait:bug/retry-config
Merge into: juju-wait:master
Diff against target: 13 lines (+2/-1)
1 file modified
juju_wait/__init__.py (+2/-1)
Reviewer Review Type Date Requested Status
Stuart Bishop 2017-07-12 Approve on 2017-07-13
Review via email: mp+327334@code.launchpad.net

Description of the Change

The model config was not being read properly because of a trailing newline.

To post a comment you must log in.
Stuart Bishop (stub) wrote :

It's attempting to run juju model-config before the version check, and that will fail with Juju 1.x

review: Needs Fixing
Stuart Bishop (stub) wrote :

This sort of bug is why it is preferable to decode yaml or json. But this seems fine for now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/juju_wait/__init__.py b/juju_wait/__init__.py
2index 3917148..f359815 100755
3--- a/juju_wait/__init__.py
4+++ b/juju_wait/__init__.py
5@@ -247,7 +247,8 @@ def wait_cmd(args=sys.argv[1:]):
6 if juju('version').startswith('1.'):
7 logging.warning('Ignoring --retry_errors on Juju 1.x')
8 args.retry_errors = 0
9- elif juju('model-config', 'automatically-retry-hooks') != 'True':
10+ elif juju('model-config',
11+ 'automatically-retry-hooks').strip() != 'True':
12 logging.warning('Ignoring --retry_errors when retries disabled')
13 args.retry_errors = 0
14

Subscribers

People subscribed via source and target branches

to all changes: