Change in vdsm[master]: configurator.py: fix _removeFile to do as described in it's ...

nsoffer at redhat.com nsoffer at redhat.com
Fri Jun 20 16:43:05 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: configurator.py: fix _removeFile to do as described in it's doc string.
......................................................................


Patch Set 5: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/28782/5/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:

Line 325:         try:
Line 326:             os.unlink(content['path'])
Line 327:         except OSError as e:
Line 328:             if e.errno != errno.ENOENT:
Line 329:                 raise InvalidRun("Removing file: %s failed", content['path'])
This is unexpected failure that you cannot handle. It should cause the operation to fail and show a tracback.

What you do here is the worst possible thing - hide the error details!

Should be:

    if e.errno != errno.ENOENT:
        raise
Line 330: 
Line 331:     def _unprefixAndRemoveSection(self, path):
Line 332:         """
Line 333:         undo changes done by _prefixAndPrepend.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0436832ae63891c097038ef2b76606c30c40328a
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list