juju-log is not compatible with python version

Bug #1130771 reported by Roger Peppe
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnuflag
New
Undecided
Unassigned
juju-core
Won't Fix
Low
Unassigned

Bug Description

The python version of the juju-log command allows
some arguments starting with "--" to go through
as the message.

For instance:

   juju-log '--> foo'

will log the message "--> foo" in the python version,
but give an error in the Go version.

The python version does not ignore *all* flags.
For instance,

   juju-log '-->foo'

will yield an error in both versions,

Unfortunately the python charm helpers rely on this
functionality, so break under Go:

http://bazaar.launchpad.net/~charmers/charm-tools/trunk/view/head:/helpers/python/charmhelpers/__init__.py#L51

We have several possible solutions here:
1) Fix the charms so they don't print log messages starting with "--"
2) Fix juju so that the log command ignores all flags (not *too* unreasonable as we
don't support log levels)
3) Fix gnuflag so that it's more like python argparse in this respect.
4) ???

Tags: juju-log ui
Revision history for this message
William Reade (fwereade) wrote :

1) is not really workable, because we don't control all charms.
2) feels pretty nasty, and I'd rather avoid it.
3) feels like the least worst solution; if it offends your sensibilities too much, adding a flag (as we did with AllowIntersperse) may be the way forward.

(I can't think of a (4).)

Revision history for this message
Tim Penhey (thumper) wrote :

Perhaps we just fix gnuflag to ignore parameters that start with - or -- that have an embedded space?

tags: added: ui
Changed in juju-core:
status: New → Triaged
importance: Undecided → Low
Curtis Hovey (sinzui)
tags: added: juju-log
Changed in juju-core:
status: Triaged → Won't Fix
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.