Change in vdsm[master]: configNet: grant proper selinux context to ifcfg-*

danken at redhat.com danken at redhat.com
Mon Aug 27 06:52:21 UTC 2012


Dan Kenigsberg has posted comments on this change.

Change subject: configNet: grant proper selinux context to ifcfg-*
......................................................................


Patch Set 1: (2 inline comments)

....................................................
File vdsm/configNetwork.py
Line 372:         open(fileName, 'w').write(configuration)
Line 373:         os.chmod(fileName, 0664)
Line 374:         try:
Line 375:             selinux.restorecon(fileName)
Line 376:         except:
frankly, I do not remember what is raise, or even why... I just copied the behavior from deployUtil.silentRestoreCon, see http://gerrit.ovirt.org/1022
Line 377:             logging.debug('ignoring restorecon error in case SElinux is '
Line 378:                           'disabled', exc_info=True)
Line 379: 
Line 380:     def _createConfFile(self, conf, name, ipaddr=None, netmask=None,


Line 374:         try:
Line 375:             selinux.restorecon(fileName)
Line 376:         except:
Line 377:             logging.debug('ignoring restorecon error in case SElinux is '
Line 378:                           'disabled', exc_info=True)
if swallowing exceptions is bad, loosing the backtrace info is negligence.

we do care about the context after restore. Luckily, in your new implementation, this is done right here, too.
Line 379: 
Line 380:     def _createConfFile(self, conf, name, ipaddr=None, netmask=None,
Line 381:                 gateway=None, bootproto=None, mtu=None, onboot='yes', **kwargs):
Line 382:         """ Create ifcfg-* file with proper fields per device """


--
To view, visit http://gerrit.ovirt.org/7478
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3cb63872794367a7c6fa76cc753698c9402b449
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list