When tools: efivar.py is called without arguments an error occurs:
Traceback (most recent call last):
File "tools/efivar.py", line 380, in <module>
main()
File "tools/efivar.py", line 360, in main
args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
Show the online help if the arguments do not specify a function.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
signp.set_defaults(func=cmd_sign)
args = ap.parse_args()
- args.func(args)
+ if hasattr(args, "func"):
+ args.func(args)
+ else:
+ ap.print_help()
def group(a, *ns):
for n in ns: