]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: show error when no command is specified 34485/head
authorMichael Fritch <mfritch@suse.com>
Wed, 8 Apr 2020 20:42:12 +0000 (14:42 -0600)
committerMichael Fritch <mfritch@suse.com>
Wed, 8 Apr 2020 20:43:41 +0000 (14:43 -0600)
Traceback (most recent call last):
  File "./cephadm", line 4452, in <module>
    if args.func != command_check_host:
AttributeError: 'Namespace' object has no attribute 'func'

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index 984786295b41eb2958148fec30bfb4702739178e..16965d61bb5a471fb931998714ecfdba92077e70 100755 (executable)
@@ -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: