forked from ungleich-public/cdist
Remove ugly argumentparser bug
Before:
[21:09] bento:~% cdist
Traceback (most recent call last):
File "/home/users/nico/p/cdist/cdist/bin/../scripts/cdist", line 232, in <module>
commandline()
File "/home/users/nico/p/cdist/cdist/bin/../scripts/cdist", line 106, in commandline
args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
After:
[21:11] bento:~% cdist
usage: cdist [-h] [-d] [-v] [-V] {banner,config} ...
cdist 2.1.1-48-gfd72c60
optional arguments:
-h, --help show this help message and exit
-d, --debug Set log level to debug
-v, --verbose Set log level to info, be more verbose
-V, --version Show version
Commands:
{banner,config}
Get cdist at http://www.nico.schottelius.org/software/cdist/
[21:11] bento:~%
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
parent
96e58af1da
commit
9195c9b8e8
1 changed files with 8 additions and 1 deletions
|
|
@ -103,7 +103,14 @@ def commandline():
|
|||
logging.root.setLevel(logging.DEBUG)
|
||||
|
||||
log.debug(args)
|
||||
args.func(args)
|
||||
|
||||
# Work around python 3.3 bug:
|
||||
# http://bugs.python.org/issue16308
|
||||
# http://bugs.python.org/issue9253
|
||||
try:
|
||||
args.func(args)
|
||||
except AttributeError:
|
||||
parser['main'].print_help()
|
||||
|
||||
def config(args):
|
||||
configinstall(args, mode=cdist.config.Config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue