New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ceph-daemon: infer fsid for some commands #31702
Conversation
src/ceph-daemon/ceph-daemon
Outdated
@@ -226,6 +226,21 @@ def is_fsid(s): | |||
return False | |||
return True | |||
|
|||
def infer_fsid(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also a way to infer the fsid by looking as the ceph-volume LVs.
def infer_fsid(): | |
def infer_fsid_from_dirname(): |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe if c-v weren't so slow...
src/ceph-daemon/ceph-daemon
Outdated
@@ -1252,6 +1267,7 @@ def command_run(): | |||
|
|||
def command_shell(): | |||
# type: () -> int | |||
infer_fsid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this all over the place seems wrong to me, though. can we call infer_fsid
one place only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that deliberately so that we infer only in cases where it is not dangerous to do so. 'deploy' is used only by mgr/ssh, so we don't do it there, and we definitely don't want to for rm-cluster or rm-daemon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's cleaner todo this as a python decorator ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's cleaner todo this as a python decorator ?
src/ceph-daemon/ceph-daemon
Outdated
for i in os.listdir(args.data_dir): | ||
if is_fsid(i): | ||
if first: | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise RuntimeError
when more than one fsid is found?
src/ceph-daemon/ceph-daemon
Outdated
@@ -1252,6 +1267,7 @@ def command_run(): | |||
|
|||
def command_shell(): | |||
# type: () -> int | |||
infer_fsid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's cleaner todo this as a python decorator ?
168f4f0
to
bbdafce
Compare
@mgfritch I made a few minor changes to your patch--much nicer! Except that it doesn't seem to work... it just returns without running the decorated function. I don't really understand how these decorations are supposed to work.. can you take a look?
|
@liewegas oops! I forgot to return the wrapped func ...
|
Signed-off-by: Michael Fritch <mfritch@suse.com>
7d919cf
to
4312ca8
Compare
Also fixed up
|
retest this please |
1 similar comment
retest this please |
* refs/pull/31702/head: ceph-daemon: infer fsid for shell, enter, ceph-volume, unit, logs Reviewed-by: Michael Fritch <mfritch@suse.com> Reviewed-by: Sebastian Wagner <swagner@suse.com>
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard backend
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox