Change in vdsm[master]: virt: recovery: use proper os.path functions

fromani at redhat.com fromani at redhat.com
Wed Feb 3 13:59:43 UTC 2016


Francesco Romani has uploaded a new change for review.

Change subject: virt: recovery: use proper os.path functions
......................................................................

virt: recovery: use proper os.path functions

Use the facilities from os.path wherever we
need them, instead of roll our own poor's man versions.

No changes in functionality are expected.

Change-Id: I93935e32e4169efa8f03be1bfc1d7021374ee68e
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/recovery.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/53053/1

diff --git a/vdsm/virt/recovery.py b/vdsm/virt/recovery.py
index 1028839..e41309a 100644
--- a/vdsm/virt/recovery.py
+++ b/vdsm/virt/recovery.py
@@ -215,11 +215,11 @@
 def clean_vm_files(cif):
     for f in os.listdir(constants.P_VDSM_RUN):
         try:
-            vmId, fileType = f.split(".", 1)
+            vmId, fileType = os.path.splitext(f)
         except ValueError:
             # If file is missing type extention - ignore it
             pass
         else:
-            if fileType == "recovery" and vmId not in cif.vmContainer:
+            if fileType == ".recovery" and vmId not in cif.vmContainer:
                 cif.log.debug("cleaning old file " + f)
-                utils.rmFile(constants.P_VDSM_RUN + f)
+                utils.rmFile(os.path.join(constants.P_VDSM_RUN, f))


-- 
To view, visit https://gerrit.ovirt.org/53053
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93935e32e4169efa8f03be1bfc1d7021374ee68e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list