Hello Nir Soffer, Yaniv Bronhaim, Dan Kenigsberg, Oved Ourfali,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/31778

to review the following change.

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

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

Remove file in a non racy way without using the utils.rmFile()
which assumes the file exists.

Change-Id: I0436832ae63891c097038ef2b76606c30c40328a
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1109569
Signed-off-by: Mooli Tayer <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/28782
Reviewed-by: Oved Ourfali <[email protected]>
Reviewed-by: Nir Soffer <[email protected]>
Reviewed-by: Yaniv Bronhaim <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M lib/vdsm/tool/configurator.py
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/78/31778/1

diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index 9c9e33d..8136613 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -18,6 +18,7 @@
 #
 
 import argparse
+import errno
 import filecmp
 import grp
 import os
@@ -321,7 +322,11 @@
         if utils.isOvirtNode():
             NodeCfg().delete(content['path'])
         else:
-            utils.rmFile(content['path'])
+            try:
+                os.unlink(content['path'])
+            except OSError as e:
+                if e.errno != errno.ENOENT:
+                    raise
 
     def _unprefixAndRemoveSection(self, path):
         """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0436832ae63891c097038ef2b76606c30c40328a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: mooli tayer <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to