Thanks craftyguy! Probably meant to call 'globals()' and not 'locals()'. As @MartijnBraam pointed out in IRC, probably best to have these functions in a separate module so they can be parsed with getattr
This commit is contained in:
parent
a502b50475
commit
fc3e4bfe4a
|
@ -137,12 +137,11 @@ def main():
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
# If an action_xxx function is defined in local scope, run it with args
|
# If an action_xxx function is defined in local scope, run it with args
|
||||||
func = locals().get('action_' + args.action)
|
func = globals().get('action_' + args.action)
|
||||||
if func:
|
if func:
|
||||||
func(args)
|
func(args)
|
||||||
else:
|
else:
|
||||||
logging.info("Run pmbootstrap -h for usage information.")
|
logging.info("Run pmbootstrap -h for usage information.")
|
||||||
|
|
||||||
# Print finish timestamp
|
# Print finish timestamp
|
||||||
logging.info("Done")
|
logging.info("Done")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue