[NEW PATCH] Related to BZ#726400 - Rename links for cleaning (via gerrit-bot)
Eduardo Warszawski
ewarszaw at redhat.com
Thu Aug 25 14:12:42 UTC 2011
New patch submitted by Eduardo Warszawski (ewarszaw at redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/818
commit 6dfb25dd80cb930eae11c3a25f1f7a433b0170d6
Author: Eduardo Warszawski <ewarszaw at redhat.com>
Date: Thu Aug 11 18:30:35 2011 +0300
Related to BZ#726400 - Rename links for cleaning
Change-Id: I407a377b269cb90c9e7335ec33844c9eb3403332
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 24c8996..5ae00e7 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -844,7 +844,7 @@ class StoragePool:
# Find out all domains for future cleanup
domainpat = os.path.join(self.poolPath, constants.UUID_GLOB_PATTERN)
- cleanupdomains = glob(domainpat)
+ oldLinks = glob(domainpat)
# We should not rebuild non-active domains, because
# they are probably disconnected from the host
@@ -871,26 +871,26 @@ class StoragePool:
continue
# Remove domain from potential cleanup
linkName = os.path.join(self.poolPath, domUUID)
- if linkName in cleanupdomains:
- cleanupdomains.remove(linkName)
+ if linkName in oldLinks:
+ oldLinks.remove(linkName)
# Always try to build master links
try:
self._refreshDomainLinks(msd)
except (se.StorageException, OSError):
self.log.error("_refreshDomainLinks failed for master domain %s", msd.sdUUID, exc_info=True)
linkName = os.path.join(self.poolPath, msd.sdUUID)
- if linkName in cleanupdomains:
- cleanupdomains.remove(linkName)
+ if linkName in oldLinks:
+ oldLinks.remove(linkName)
- # Clenup old trash from the pool
- for i in cleanupdomains:
+ # Cleanup old trash from the pool
+ for oldie in oldLinks:
try:
- os.remove(i)
+ os.remove(oldie)
except OSError as e:
if e.errno != errno.ENOENT:
- self.log.warn("Could not clean all trash from the pool dom `%s` (%s)", i, e)
+ self.log.warn("Could not clean all trash from the pool dom `%s` (%s)", oldie, e)
except Exception as e:
- self.log.warn("Could not clean all trash from the pool dom `%s` (%s)", i, e)
+ self.log.warn("Could not clean all trash from the pool dom `%s` (%s)", oldie, e)
def refresh(self, msdUUID=None, masterVersion=None):
More information about the vdsm-patches
mailing list