~james-page/charms/trusty/neutron-api/ml2-local-types

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/cli/__init__.py

  • Committer: Corey Bryant
  • Date: 2015-08-18 17:34:35 UTC
  • Revision ID: corey.bryant@canonical.com-20150818173435-hys8o9jzxf5ogf7f
[corey.bryant,r=trivial] Sync charm-helpers to pick up Liberty support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
        arguments = self.argument_parser.parse_args()
153
153
        argspec = inspect.getargspec(arguments.func)
154
154
        vargs = []
155
 
        kwargs = {}
156
155
        for arg in argspec.args:
157
156
            vargs.append(getattr(arguments, arg))
158
157
        if argspec.varargs:
159
158
            vargs.extend(getattr(arguments, argspec.varargs))
160
 
        if argspec.keywords:
161
 
            for kwarg in argspec.keywords.items():
162
 
                kwargs[kwarg] = getattr(arguments, kwarg)
163
 
        output = arguments.func(*vargs, **kwargs)
 
159
        output = arguments.func(*vargs)
164
160
        if getattr(arguments.func, '_cli_test_command', False):
165
161
            self.exit_code = 0 if output else 1
166
162
            output = ''