~canonical-sysadmins/charms/trusty/nova-compute/smt-off-ppc64el

« back to all changes in this revision

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

  • Committer: Christopher Glass
  • Date: 2015-09-23 07:41:40 UTC
  • mfrom: (136.1.4 nova-compute)
  • Revision ID: christopher.glass@canonical.com-20150923074140-9vw5mtrvibkc2hyl
Merge lp:~gnuoy/charms/trusty/nova-compute/1453940-stable [a=gnuoy] [r=tribaal]

Hook the ceph broker mechanism introduced in charm-helpers to the nova-compute charm.

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 = ''