From: Michael Fritch Date: Wed, 8 Apr 2020 20:42:12 +0000 (-0600) Subject: cephadm: show error when no command is specified X-Git-Tag: v16.1.0~2643^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2ebb9373b52342eb8c523866e5852d2b8bf44e58;p=ceph.git cephadm: show error when no command is specified Traceback (most recent call last): File "./cephadm", line 4452, in if args.func != command_check_host: AttributeError: 'Namespace' object has no attribute 'func' Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 984786295b41..16965d61bb5a 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -4448,6 +4448,10 @@ if __name__ == "__main__": sys.stderr.write('ERROR: cephadm should be run as root\n') sys.exit(1) + if 'func' not in args: + sys.stderr.write('No command specified; pass -h or --help for usage\n') + sys.exit(1) + # podman or docker? if args.func != command_check_host: if args.docker: @@ -4463,10 +4467,6 @@ if __name__ == "__main__": sys.stderr.write('Unable to locate any of %s\n' % CONTAINER_PREFERENCE) sys.exit(1) - if 'func' not in args: - sys.stderr.write('No command specified; pass -h or --help for usage\n') - sys.exit(1) - try: r = args.func() except Error as e: