Merge lp:~bcsaller/pyjuju/log-output into lp:pyjuju
Proposed by
Benjamin Saller
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 534 | ||||
Proposed branch: | lp:~bcsaller/pyjuju/log-output | ||||
Merge into: | lp:pyjuju | ||||
Diff against target: |
52 lines (+11/-4) 2 files modified
juju/hooks/commands.py (+4/-1) juju/hooks/tests/test_invoker.py (+7/-3) |
||||
To merge this branch: | bzr merge lp:~bcsaller/pyjuju/log-output | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+103762@code.launchpad.net |
Description of the change
juju-log shouldn't log {} to stdout
The default output format for juju-log was including a marshalled response of an empty dict. This masks that output.
To post a comment you must log in.
Reviewers: mp+103762_ code.launchpad. net,
Message:
Please take a look.
Description:
juju-log shouldn't log {} to stdout
The default output format for juju-log was including a marshalled
response of an empty dict. This masks that output.
https:/ /code.launchpad .net/~bcsaller/ juju/log- output/ +merge/ 103762
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6114061/
Affected files: tests/test_ invoker. py
A [revision details]
M juju/hooks/cli.py
M juju/hooks/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: juju/hooks/cli.py
=== modified file 'juju/hooks/cli.py'
--- juju/hooks/cli.py 2012-03-27 01:04:50 +0000
+++ juju/hooks/cli.py 2012-04-26 03:51:20 +0000
@@ -225,7 +225,7 @@
print >>stream, json.dumps(result)
def format_smart(self, result, stream):
- if result is not None:
+ if result is not None and not isinstance(result, dict):
print >>stream, str(result)
Index: juju/hooks/ tests/test_ invoker. py tests/test_ invoker. py' tests/test_ invoker. py 2012-04-25 00:20:26 +0000 tests/test_ invoker. py 2012-04-26 03:51:20 +0000 get_test_ hook("echo- hook"))
self. assertEqual( result, 0)
self. assertIn( message, self.log. getvalue( )) n("{}", self.log. getvalue( ))
=== modified file 'juju/hooks/
--- juju/hooks/
+++ juju/hooks/
@@ -827,9 +827,13 @@
# of the MESSAGE variable
result = yield exe(self.
-
yield exe.ended
+
+ # Logging used to log an empty response dict
+ # assure this doesn't happpen [b=915506]
+ self.assertNotI
+
# The 'error' was sent via juju-log
# to the UA. Our test UA has a fake log stream
# which we can check now