Merge lp:~johnsca/charm-helpers/unitdata-cli into lp:charm-helpers

Proposed by Cory Johns
Status: Merged
Merged at revision: 478
Proposed branch: lp:~johnsca/charm-helpers/unitdata-cli
Merge into: lp:charm-helpers
Diff against target: 23 lines (+3/-3)
1 file modified
charmhelpers/cli/__init__.py (+3/-3)
To merge this branch: bzr merge lp:~johnsca/charm-helpers/unitdata-cli
Reviewer Review Type Date Requested Status
Charles Butler (community) Approve
Review via email: mp+277034@code.launchpad.net

Description of the change

Fixed unitdata subcommand not being registered due to the import masking the import of the proper package.

To post a comment you must log in.
Revision history for this message
Charles Butler (lazypower) wrote :

This looks reasonable, but i'm not familiar with the issue this resolves... Was unitdata not being exposed via chlp?

Revision history for this message
Cory Johns (johnsca) wrote :

I should have been more clear. The unitdata subcommand wasn't getting registered for chlp because in charmhelpers/cli/commands.py it was doing "from . import unitdata" to import charmhelpers/cli/unitdata.py to register the command but this import made it so charmheleprs.cli already had a unitdata attribute so it just used that instead of doing the import.

Revision history for this message
Charles Butler (lazypower) wrote :

+1 Approved. Thanks for the patch cory! LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmhelpers/cli/__init__.py'
--- charmhelpers/cli/__init__.py 2015-08-04 20:02:59 +0000
+++ charmhelpers/cli/__init__.py 2015-11-09 16:55:59 +0000
@@ -20,7 +20,7 @@
2020
21from six.moves import zip21from six.moves import zip
2222
23from charmhelpers.core import unitdata23import charmhelpers.core.unitdata
2424
2525
26class OutputFormatter(object):26class OutputFormatter(object):
@@ -163,8 +163,8 @@
163 if getattr(arguments.func, '_cli_no_output', False):163 if getattr(arguments.func, '_cli_no_output', False):
164 output = ''164 output = ''
165 self.formatter.format_output(output, arguments.format)165 self.formatter.format_output(output, arguments.format)
166 if unitdata._KV:166 if charmhelpers.core.unitdata._KV:
167 unitdata._KV.flush()167 charmhelpers.core.unitdata._KV.flush()
168168
169169
170cmdline = CommandLine()170cmdline = CommandLine()

Subscribers

People subscribed via source and target branches