Dima Kuznetsov has posted comments on this change.
Change subject: caps: Add selinux enforcement reporting. ......................................................................
Patch Set 1:
(3 comments)
http://gerrit.ovirt.org/#/c/26951/1/vdsm/caps.py File vdsm/caps.py:
Line 390: else: Line 391: return platform.machine() Line 392: Line 393: Line 394: def getSELinuxEnforceMode():
What about have this function available in /usr/<lib>/python-2.7/site-packa
ok Line 395: selinux_mnts = ['/sys/fs/selinux', '/selinux'] Line 396: for mnt in selinux_mnts: Line 397: enforce_path = os.path.join(mnt, 'enforce') Line 398: if not os.path.exists(enforce_path):
Line 401: with open(enforce_path) as fileStream: Line 402: return int(fileStream.read().strip()) Line 403: Line 404: # Assume disabled if cannot find Line 405: return -1
Agree with yaniv, please use docstring format.
ok Line 406: Line 407: Line 408: def get(): Line 409: targetArch = getTargetArch()
Line 474: caps['numaNodeDistance'] = _getNumaNodeDistance() Line 475: caps['autoNumaBalancing'] = _getAutoNumaBalancingInfo() Line 476: Line 477: if selinux.is_selinux_enabled() == 0: Line 478: caps['selinuxEnforceMode'] = str(-1)
+1 for Yaniv comment.
Yes will change Line 479: else: Line 480: caps['selinuxEnforceMode'] = getSELinuxEnforceMode() Line 481: return caps Line 482: