Merge lp://qastaging/~mew/charm-helpers/commandant into lp://qastaging/charm-helpers
Proposed by
Matthew Wedgwood
Status: | Merged |
---|---|
Merged at revision: | 72 |
Proposed branch: | lp://qastaging/~mew/charm-helpers/commandant |
Merge into: | lp://qastaging/charm-helpers |
Diff against target: |
519 lines (+464/-0) 8 files modified
bin/chlp (+7/-0) charmhelpers/cli/README.rst (+57/-0) charmhelpers/cli/__init__.py (+147/-0) charmhelpers/cli/commands.py (+2/-0) charmhelpers/cli/host.py (+14/-0) setup.py (+2/-0) tests/cli/test_cmdline.py (+189/-0) tests/cli/test_function_signature_analysis.py (+46/-0) |
To merge this branch: | bzr merge lp://qastaging/~mew/charm-helpers/commandant |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nicola Larosa (community) | Approve | ||
Matthew Wedgwood (community) | Needs Resubmitting | ||
Review via email:
|
Description of the change
Add CLI support to charm-helpers, allowing helpers to be used in charms written in other languages.
charmhelpers.cli adds a framework for building CLI commands from helpers. New commands are implemented by defining wrapper methods decorated with CommandLine.
To post a comment you must log in.
All this looks well put together. The CommandLine class makes my head spin a little, but I guess it'll just take some getting accustomed to it. :-)
There is a bug in charmhelpers/ cli/__init_ _.py . Line 137:
should be:
It does not show up in the test_positional _arguments test in tests/cli/ test_function_ signature_ analysis. py because the call to cli.describe_ arguments has no default arguments, and the other ones only have one positional argument each.
Add "z=2" to the cli.describe_ arguments call parameters in test_positional _arguments, and watch the "y" disappear from the test output. Add the minus sign above to the code, and watch the "y" appear again.
Getting one error when running tests, in tests.core. test_host. HelpersTest. test_installs_ apt_packages_ with_possible_ errors . Same thing in trunk, though.
I also get this near the beginning of the test run:
usage: nosetests [-h] [--format FMT | -r | -j | -p | -y | -c | -t]
{payload} ...
nosetests: error: invalid choice: 'd' (choose from 'payload')
Add flake8 <https:/ /pypi.python. org/pypi/ flake8> to test requirements.
Fix lint errors as shown by "make lint".
Wrap lines in ReST docs, so that changes are readable in diffs.