Change in vdsm[master]: multipath: Fix multipath.conf selinux labels

nsoffer at redhat.com nsoffer at redhat.com
Sat Sep 19 22:55:13 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: multipath: Fix multipath.conf selinux labels
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/46398/1/lib/vdsm/tool/configurators/multipath.py
File lib/vdsm/tool/configurators/multipath.py:

Line 120:             delete=False) as f:
Line 121:         try:
Line 122:             f.write(_CONF_DATA)
Line 123:             f.flush()
Line 124:             selinux.restorecon(f.name)
> Thanks, I'll check what is the best way to handle this error.
Tested on rhel 7.1, this does not fail when selinux is disabled.

Looking at upstream source, this code does not raise anything except OSError from os.lstat, which is a good reason to fail here.
https://github.com/SELinuxProject/selinux/blob/master/libselinux/src/selinuxswig_python.i#L17

I'll test also on fedora 21 and 22. If it does not fail I don't see a reason to add a racy check.
Line 125:             os.chmod(f.name, 0o644)
Line 126:             os.rename(f.name, _CONF_FILE)
Line 127:         except:
Line 128:             os.unlink(f.name)


-- 
To view, visit https://gerrit.ovirt.org/46398
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id0aebae46f30abf908a8f48c4f1f2257394fe616
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fdeutsch at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list