mirror of
https://github.com/ceph/ceph
synced 2025-01-04 02:02:36 +00:00
ceph.in: extract get_admin_socket() out
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>
This commit is contained in:
parent
32921b7003
commit
caba1beaf9
@ -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
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user