For safety, Python charm-helpers juju-log command should insert a "--" before the log message.

Bug #1130793 reported by Gary Poster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Charm Tools
Fix Released
Undecided
Benji York

Bug Description

The Go version of juju-log currently behaves differently than the Python one: see bug 1130771. This breaks the charm-helpers log command, and in particular the log_entry and log_exit functions (see /helpers/python/charmhelpers/__init__.py; excerpt below).

A change that would both work around the issue and be a reasonable long term change would be to make the log command insert a '--' before any log message: "log = command('juju-log', '--')" would work.

Pertinent excerpt follows.

log = command('juju-log')
# We create a juju_status Command here because it makes testing much,
# much easier.
juju_status = lambda: command('juju')('status')

def log_entry():
    log("--> Entering {}".format(script_name()))

def log_exit():
    log("<-- Exiting {}".format(script_name()))

Related branches

Benji York (benji)
Changed in charm-tools:
assignee: nobody → Benji York (benji)
status: New → In Progress
Marco Ceppi (marcoceppi)
Changed in charm-tools:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.