Commit a697a44f authored by William Lachance's avatar William Lachance
Browse files

Bug 877265 - Make dmcli parseable by python 2.6;r=ahal

parent 0d503290
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -168,7 +168,14 @@ class DMCli(object):
            subparser = subparsers.add_parser(commandname, help=commandprops['help'])
            if commandprops.get('args'):
                for arg in commandprops['args']:
                    kwargs = { k: v for k,v in arg.items() if k is not 'name' }
                    # this is more elegant but doesn't work in python 2.6
                    # (which we still use on tbpl @ mozilla where we install
                    # this package)
                    # kwargs = { k: v for k,v in arg.items() if k is not 'name' }
                    kwargs = {}
                    for (k, v) in arg.items():
                        if k is not 'name':
                            kwargs[k] = v
                    subparser.add_argument(arg['name'], **kwargs)
            subparser.set_defaults(func=commandprops['function'])