]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: show error when no command is specified
authorMichael Fritch <mfritch@suse.com>
Wed, 8 Apr 2020 20:42:12 +0000 (14:42 -0600)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 14 Apr 2020 14:50:50 +0000 (16:50 +0200)
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>
(cherry picked from commit 2ebb9373b52342eb8c523866e5852d2b8bf44e58)

src/cephadm/cephadm

index ee65ab7cca69e1223383b9766bff825ba0d6ee2c..a73850117db2bb3a2c50965ab3525b839a863ea3 100755 (executable)
@@ -4433,6 +4433,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:
@@ -4448,10 +4452,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: