Skip to content
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

Merged
merged 2 commits into from
Feb 10, 2020

Conversation

shyukri
Copy link
Contributor

@shyukri shyukri commented Jan 25, 2020

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

Jan Fajerski added 2 commits January 25, 2020 22:50
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)
@shyukri shyukri requested a review from jan--f January 25, 2020 20:51
@tchaikov tchaikov added this to the mimic milestone Jan 26, 2020
try:
stdout, stderr, code = process.call(['selinuxenabled'],
verbose_on_failure=False)
except FileNotFoundError:
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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.

@jan--f
Copy link
Contributor

jan--f commented Feb 7, 2020

jenkins test ceph-volume tox

@jan--f
Copy link
Contributor

jan--f commented Feb 7, 2020

test failure is fixed in #33124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants