]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: extract get_admin_socket() out
authorKefu Chai <kchai@redhat.com>
Tue, 15 Dec 2020 14:55:41 +0000 (22:55 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 15 Dec 2020 18:01:12 +0000 (02:01 +0800)
will add retry support to this function, so we can use an alternative
name for the admin_socket path if the path is not a valid file.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/ceph.in
src/test/cli/ceph-conf/help.t

index 9d535eb842a21894fe2233c3992905eac00c8bcc..2ee2f3d6c2ef25d6e118a09bff8f672026b3fe5c 100755 (executable)
@@ -730,6 +730,10 @@ def ping_monitor(cluster_handle, name, timeout):
     return 0
 
 
+def get_admin_socket(parsed_args, name):
+    return ceph_conf(parsed_args, 'admin_socket', name)
+
+
 def maybe_daemon_command(parsed_args, childargs):
     """
     Check if --admin-socket, daemon, or daemonperf command
@@ -751,8 +755,7 @@ def maybe_daemon_command(parsed_args, childargs):
             else:
                 # try resolve daemon name
                 try:
-                    sockpath = ceph_conf(parsed_args, 'admin_socket',
-                                         childargs[1])
+                    sockpath = get_admin_socket(parsed_args, childargs[1])
                 except Exception as e:
                     print('Can\'t get admin socket path: ' + str(e), file=sys.stderr)
                     return True, errno.EINVAL
index 8fa2152d3949e71db4ac56a581da8713a443037e..751b3a54ae9baaae1cfe785246a6f49f1b69a113 100644 (file)
@@ -28,6 +28,7 @@
     [--format plain|json|json-pretty]
                                     dump variables in plain text, json or pretty
                                     json
+    [--pid <pid>]                   Override the $pid when expanding options
   
   If there is no action given, the action will default to --lookup.