-
Notifications
You must be signed in to change notification settings - Fork 6k
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
mimic: ceph-volume: check if we run in an selinux environment #32866
Conversation
Popen does not open a shell by default, so A FileNotFoundError is raised instead of returning a 127 return code. Signed-off-by: Jan Fajerski <jfajerski@suse.com> (cherry picked from commit af30c7f)
Expect selinux related binaries to not be present. Fixes: 33c8a64 Fixes: https://tracker.ceph.com/issues/42957 Signed-off-by: Jan Fajerski <jfajerski@suse.com> (cherry picked from commit 72b79f7)
try: | ||
stdout, stderr, code = process.call(['selinuxenabled'], | ||
verbose_on_failure=False) | ||
except FileNotFoundError: |
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.
$ head -1 /usr/sbin/ceph-volume
#!/usr/bin/python2.7
FileNotFoundError is not defined in python2 and the actual exception is 'OSError'. In my testing on Xenial I was able to get it to work by adding the following block before your 'try' block.
try:
FileNotFoundError
except NameError:
FileNotFoundError = OSError
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.
This issue is actually described in #31809 but oddly nothing was done about it.
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.
@badone There is a separate issue for this https://tracker.ceph.com/issues/42967. Here is the backport of it #32867
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.
@jan--f ack, thanks, that explains it.
jenkins test ceph-volume tox |
test failure is fixed in #33124 |
backport tracker: https://tracker.ceph.com/issues/42966
backport of #31809
parent tracker: https://tracker.ceph.com/issues/42957
this backport was staged using ceph-backport.sh version 15.0.0.6950
find the latest version at https://github.com/ceph/ceph/blob/master/src/script/ceph-backport.sh