Merge lp://staging/~frankban/charms/precise/juju-gui/bug-1132905-log-hook into lp://staging/~juju-gui/charms/precise/juju-gui/trunk

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 32
Proposed branch: lp://staging/~frankban/charms/precise/juju-gui/bug-1132905-log-hook
Merge into: lp://staging/~juju-gui/charms/precise/juju-gui/trunk
Diff against target: 285 lines (+83/-41)
6 files modified
hooks/config-changed (+2/-11)
hooks/install (+4/-14)
hooks/start (+2/-6)
hooks/stop (+6/-10)
hooks/utils.py (+23/-0)
tests/test_utils.py (+46/-0)
To merge this branch: bzr merge lp://staging/~frankban/charms/precise/juju-gui/bug-1132905-log-hook
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+150413@code.staging.launchpad.net

Description of the change

Add and use a log_hook context manager.

Replace the current calls to log_entry and log_exit in the __main__ of
the hooks with a log_hook context manager, simplifying the code a bit.

Avoiding log_entry and log_exit also temporarily works around a problem
they have with the juju-core handling of strings starting with "--" in
juju-log.

https://codereview.appspot.com/7379050/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :

Reviewers: mp+150413_code.launchpad.net,

Message:
Please take a look.

Description:
Add and use a log_hook context manager.

Replace the current calls to log_entry and log_exit in the __main__ of
the hooks with a log_hook context manager, simplifying the code a bit.

Avoiding log_entry and log_exit also temporarily works around a problem
they have with the juju-core handling of strings starting with "--" in
juju-log.

https://code.launchpad.net/~frankban/charms/precise/juju-gui/bug-1132905-log-hook/+merge/150413

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/7379050/

Affected files:
   A [revision details]
   M hooks/config-changed
   M hooks/install
   M hooks/start
   M hooks/stop
   M hooks/utils.py
   M tests/test_utils.py

Revision history for this message
Gary Poster (gary) wrote :
Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Add and use a log_hook context manager.

Replace the current calls to log_entry and log_exit in the __main__ of
the hooks with a log_hook context manager, simplifying the code a bit.

Avoiding log_entry and log_exit also temporarily works around a problem
they have with the juju-core handling of strings starting with "--" in
juju-log.

R=gary.poster
CC=
https://codereview.appspot.com/7379050

https://codereview.appspot.com/7379050/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches