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
1=== modified file 'charmhelpers/cli/__init__.py'
2--- charmhelpers/cli/__init__.py 2015-08-04 20:02:59 +0000
3+++ charmhelpers/cli/__init__.py 2015-11-09 16:55:59 +0000
4@@ -20,7 +20,7 @@
5
6 from six.moves import zip
7
8-from charmhelpers.core import unitdata
9+import charmhelpers.core.unitdata
10
11
12 class OutputFormatter(object):
13@@ -163,8 +163,8 @@
14 if getattr(arguments.func, '_cli_no_output', False):
15 output = ''
16 self.formatter.format_output(output, arguments.format)
17- if unitdata._KV:
18- unitdata._KV.flush()
19+ if charmhelpers.core.unitdata._KV:
20+ charmhelpers.core.unitdata._KV.flush()
21
22
23 cmdline = CommandLine()

Subscribers

People subscribed via source and target branches