MDSAuthCaps: print better error message for perm flag in MDS caps#52042
MDSAuthCaps: print better error message for perm flag in MDS caps#52042rishabh-d-dave merged 3 commits intoceph:mainfrom
Conversation
3a8120a to
09f016f
Compare
09f016f to
dcf08d1
Compare
|
jenkins test make check |
dcf08d1 to
1e9db39
Compare
|
jenkins test api |
1e9db39 to
42ec3b7
Compare
8e33571 to
fe3e22b
Compare
fe3e22b to
361eb7b
Compare
a2c5d02 to
f200f5c
Compare
rishabh-d-dave
left a comment
There was a problem hiding this comment.
CephFS integration tests passed - https://tracker.ceph.com/projects/cephfs/wiki/Main#6-Sep-2023-Run-2
|
jenkins test make check |
After |
|
jenkins test make check |
|
The make check failure is strange - But there is not "name" StringIO in these lines - |
|
jenkins test make check |
|
Same issue again - |
|
Same command locally doesn't detect any issue - |
Which means something is boken - checking. |
qa/tasks/cephfs/cephfs_test_case.py
Outdated
| # conducting negative testing | ||
| kwargs['check_status'] = False | ||
| # stderr is needed to check for expected error messages. | ||
| kwargs['stderr'] = StringIO() |
There was a problem hiding this comment.
flake8: commands[0] /home/jenkins-build/build/workspace/ceph-pull-requests/qa> flake8 --select=F,E9 --exclude=venv,.tox
./tasks/cephfs/cephfs_test_case.py:458:28: F821 undefined name 'StringIO'
flake8: exit 1 (5.34 seconds) /home/jenkins-build/build/workspace/ceph-pull-requests/qa> flake8 --select=F,E9 --exclude=venv,.tox pid=2139318
flake8: FAIL ✖ in 9.49 seconds
@rishabh-d-dave It's complaining about this line. make check merges the branch into main before building and running tests.
There was a problem hiding this comment.
Thanks for the reply. StringIO is imported at the top of this file, so it can't be undefined. See - https://github.com/rishabh-d-dave/ceph/blob/better-errmsg-for-perm/qa/tasks/cephfs/cephfs_test_case.py#L5.
There was a problem hiding this comment.
That import was removed in 4b369cf by you yourself ;)
There was a problem hiding this comment.
True, thanks! Following Laura's steps I found out same.
Thank you so much for help!
f200f5c to
8b9e3f9
Compare
Also, add comments to explain the users the arguments are accepted by run_ceph_cmd(), get_ceph_cmd_result(), get_ceph_cmd_stdout() and negtest_ceph_cmd() methods of class RunCephCmd. Signed-off-by: Rishabh Dave <ridave@redhat.com>
Permissions mentioned in MDS caps flags can either begin with "r" or "rw", or can be "*" and "all". But it can't start with or be just "w" or something else. This is confusing for some CephFS users since MON caps can be just "w". Command "ceph fs authorize" complains about this to the user. But other commands (specifically, "ceph auth add", "ceph auth caps", "ceph auth get-or-create" and "ceph auth get-or-create-key") don't. Make these commands too print a helpful message, the way "ceph fs authorize" command does. Fixes: https://tracker.ceph.com/issues/61666 Signed-off-by: Rishabh Dave <ridave@redhat.com>
For "fs authorize" command, AuthMonitor.cc checks if permissions is "r" or begins with "rw". This check is redundant now. AuthMonitor::valid_caps() runs MDSAuthCaps.parse() which now runs same check for the MDS caps, regardless of the command. Signed-off-by: Rishabh Dave <ridave@redhat.com>
8b9e3f9 to
8e1e322
Compare
|
@vshankar @gregsfortytwo @batrick Should this PR be backported? Leaving the ticket unupdated until then... |
yes, I think so. |
Permissions mentioned in MDS caps flags can either begin with "r" or
"rw", but it can't start with "w" or be just "w". This is confusing for
some CephFS users since MON caps can be just "w".
Command "ceph fs authorize" informs users that permission MDS caps have
to start with "r" or "rw" but other commands like "auth add", "auth
caps", "auth get-or-create" don't. Make these commands to print a
helpful message, the way "ceph fs authorize" command does.
https://tracker.ceph.com/issues/61666
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows