Change in vdsm[master]: configurator.py: fix _removeFile to do as described in its d...

mtayer at redhat.com mtayer at redhat.com
Mon Jun 16 09:18:51 UTC 2014


mooli tayer has uploaded a new change for review.

Change subject: configurator.py: fix _removeFile to do as described in its doc string.
......................................................................

configurator.py: fix _removeFile to do as described in its doc string.

Prevent warning on non existent files.

Change-Id: I0436832ae63891c097038ef2b76606c30c40328a
Signed-off-by: Mooli Tayer <mtayer at redhat.com>
---
M lib/vdsm/tool/configurator.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/28782/1

diff --git a/lib/vdsm/tool/configurator.py b/lib/vdsm/tool/configurator.py
index c8373fb..cc79506 100644
--- a/lib/vdsm/tool/configurator.py
+++ b/lib/vdsm/tool/configurator.py
@@ -318,9 +318,10 @@
         """
         delete a file if it exists.
         """
-        utils.rmFile(content['path'])
-        if utils.isOvirtNode():
-            NodeCfg().unpersist(content['path'])
+        if os.path.exists(content['path']):
+            utils.rmFile(content['path'])
+            if utils.isOvirtNode():
+                NodeCfg().unpersist(content['path'])
 
     def _unprefixAndRemoveSection(self, path):
         """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0436832ae63891c097038ef2b76606c30c40328a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>


More information about the vdsm-patches mailing list