From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: move vdsm.constants.UUID_GLOB_PATTERN to storage.constants
......................................................................
move vdsm.constants.UUID_GLOB_PATTERN to storage.constants
UUID_GLOB_PATTERN is used only by storage, and should be defined there
as well.
Change-Id: If50684c256ff3e732ea1f058fe7b48b9becd3ac6
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/constants.py.in
M lib/vdsm/storage/constants.py
M lib/vdsm/storage/fileSD.py
M lib/vdsm/storage/sd.py
M lib/vdsm/storage/sp.py
5 files changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/79714/1
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 7ad3eb1..6be6b57 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -62,8 +62,6 @@
# future we might slice it (eg. tuple(DOMAIN_VERSION[1:]))
SUPPORTED_DOMAIN_VERSIONS = DOMAIN_VERSIONS
-UUID_GLOB_PATTERN = '*-*-*-*-*'
-
MEGAB = 2 ** 20 # = 1024 ** 2 = 1 MiB
GIB = 1024 * MEGAB
diff --git a/lib/vdsm/storage/constants.py b/lib/vdsm/storage/constants.py
index 85fc536..d08f688 100644
--- a/lib/vdsm/storage/constants.py
+++ b/lib/vdsm/storage/constants.py
@@ -92,6 +92,8 @@
BLANK_UUID = "00000000-0000-0000-0000-000000000000"
+UUID_GLOB_PATTERN = '*-*-*-*-*'
+
def fmt2str(format):
return FMT2STR[format]
diff --git a/lib/vdsm/storage/fileSD.py b/lib/vdsm/storage/fileSD.py
index 9964f65..b9160d0 100644
--- a/lib/vdsm/storage/fileSD.py
+++ b/lib/vdsm/storage/fileSD.py
@@ -41,7 +41,7 @@
from vdsm import constants
from vdsm.utils import stripNewLines
-from vdsm.storage.constants import LEASE_FILEEXT
+from vdsm.storage.constants import LEASE_FILEEXT, UUID_GLOB_PATTERN
from vdsm import supervdsm
REMOTE_PATH = "REMOTE_PATH"
@@ -329,7 +329,7 @@
"""
# Get Volumes of an image
pattern = os.path.join(self.mountpoint, self.sdUUID, sd.DOMAIN_IMAGES,
- constants.UUID_GLOB_PATTERN)
+ UUID_GLOB_PATTERN)
files = self.oop.glob.glob(pattern)
images = set()
for i in files:
@@ -792,7 +792,7 @@
# possibleDomain that we pass to glob.
metaFiles = oop.getProcessPool(possibleDomain).glob.glob(
os.path.join(glob_escape(possibleDomain),
- constants.UUID_GLOB_PATTERN,
+ UUID_GLOB_PATTERN,
sd.DOMAIN_META_DATA))
for metaFile in metaFiles:
diff --git a/lib/vdsm/storage/sd.py b/lib/vdsm/storage/sd.py
index b121ef9..d1964ba 100644
--- a/lib/vdsm/storage/sd.py
+++ b/lib/vdsm/storage/sd.py
@@ -915,7 +915,7 @@
def getVMsList(self):
vmsPath = self.getVMsDir()
# find out VMs list
- VM_PATTERN = os.path.join(vmsPath, constants.UUID_GLOB_PATTERN)
+ VM_PATTERN = os.path.join(vmsPath, sc.UUID_GLOB_PATTERN)
vms = self.oop.glob.glob(VM_PATTERN)
vmList = [os.path.basename(i) for i in vms]
self.log.info("vmList=%s", str(vmList))
diff --git a/lib/vdsm/storage/sp.py b/lib/vdsm/storage/sp.py
index e39cbc3..e63e826 100644
--- a/lib/vdsm/storage/sp.py
+++ b/lib/vdsm/storage/sp.py
@@ -1278,7 +1278,7 @@
fileUtils.createdir(self.poolPath)
# Find out all domains for future cleanup
- domainpat = os.path.join(self.poolPath, constants.UUID_GLOB_PATTERN)
+ domainpat = os.path.join(self.poolPath, sc.UUID_GLOB_PATTERN)
oldLinks = set(iglob(domainpat))
# We should not rebuild non-active domains, because
--
To view, visit
https://gerrit.ovirt.org/79714
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If50684c256ff3e732ea1f058fe7b48b9becd3ac6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>