New patch submitted by Eduardo Warszawski (ewarszaw(a)redhat.com)
You can review this change at:
http://gerrit.usersys.redhat.com/864
commit 17827d6522cc7812d9cecbda04baeb1cf1e826e3
Author: Eduardo Warszawski <ewarszaw(a)redhat.com>
Date: Sun Aug 28 17:49:32 2011 +0300
BZ#733373, BZ#677149 - Assert clenupSpmLinks success.
Change-Id: Id16baf5c23a7b71f25030c0443710f9412252367
diff --git a/vdsm/storage/spm.py b/vdsm/storage/spm.py
index ae55e44..7ab969b 100644
--- a/vdsm/storage/spm.py
+++ b/vdsm/storage/spm.py
@@ -222,13 +222,10 @@ class SPM:
"""
Cleanup All SPM related links.
"""
- vms = glob.glob(os.path.join(cls.storage_repository, constants.UUID_GLOB_PATTERN,
sd.VMS_DIR))
- tasks = glob.glob(os.path.join(cls.storage_repository,
constants.UUID_GLOB_PATTERN, sd.TASKS_DIR))
+ vms = os.path.join(cls.storage_repository, constants.UUID_GLOB_PATTERN,
sd.VMS_DIR)
+ tasks = os.path.join(cls.storage_repository, constants.UUID_GLOB_PATTERN,
sd.TASKS_DIR)
cls.log.debug("cleaning links; %s %s", vms, tasks)
- for d in vms:
- os.unlink(d)
- for d in tasks:
- os.unlink(d)
+ misc.execCmd(['rm', "-rf", vms, tasks])
def __overrideMethods(self):