Change in vdsm[master]: StorageDomainManifest: Move getRepoPath and other basic meta...

alitke at redhat.com alitke at redhat.com
Fri Jun 12 09:59:37 UTC 2015


Adam Litke has uploaded a new change for review.

Change subject: StorageDomainManifest: Move getRepoPath and other basic metadata getters
......................................................................

StorageDomainManifest: Move getRepoPath and other basic metadata getters

Change-Id: I571437a10a53d5aa20c83438350476d03111a704
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M vdsm/storage/sd.py
1 file changed, 27 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/67/42267/1

diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 1f3ec36..c5dd224 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -306,6 +306,25 @@
     def replaceMetadata(self, md):
         self._metadata = md
 
+    def getDomainRole(self):
+        return self.getMetaParam(DMDK_ROLE)
+
+    def getDomainClass(self):
+        return self.getMetaParam(DMDK_CLASS)
+
+    def getStorageType(self):
+        return self.getMetaParam(DMDK_TYPE)
+
+    def getRepoPath(self):
+        # This is here to make sure no one tries to get a repo
+        # path from an ISO domain.
+        if self.getDomainClass() == ISO_DOMAIN:
+            raise se.ImagesNotSupportedError()
+
+        # Get the datacenter ID.  When using storage pools this will be the
+        # spUUID.  Else, it's just a UUID to establish a storage namespace.
+        return os.path.join(storage_repository, self.getPools()[0])
+
     def getIsoDomainImagesDir(self):
         """
         Get 'images' directory from Iso domain
@@ -328,6 +347,9 @@
 
     def getVersion(self):
         return self.getMetaParam(DMDK_VERSION)
+
+    def getFormat(self):
+        return str(self.getVersion())
 
 
 class StorageDomain(object):
@@ -514,7 +536,7 @@
         return self._manifest.getVersion()
 
     def getFormat(self):
-        return str(self.getVersion())
+        return self._manifest.getFormat()
 
     def getPools(self):
         try:
@@ -723,13 +745,7 @@
             self.createMasterTree()
 
     def _getRepoPath(self):
-        # This is here to make sure no one tries to get a repo
-        # path from an ISO domain.
-        if self.getDomainClass() == ISO_DOMAIN:
-            raise se.ImagesNotSupportedError()
-
-        # If it has a repo we don't have multiple domains. Assume single pool
-        return os.path.join(self.storage_repository, self.getPools()[0])
+        return self._manifest.getRepoPath()
 
     def getLinkBCImagePath(self, imgUUID):
         return image.Image(self._getRepoPath()) \
@@ -808,13 +824,13 @@
         return self._manifest.getMetaParam(key)
 
     def getStorageType(self):
-        return self.getMetaParam(DMDK_TYPE)
+        return self._manifest.getStorageType()
 
     def getDomainRole(self):
-        return self.getMetaParam(DMDK_ROLE)
+        return self._manifest.getDomainRole()
 
     def getDomainClass(self):
-        return self.getMetaParam(DMDK_CLASS)
+        return self._manifest.getDomainClass()
 
     def getRemotePath(self):
         pass


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I571437a10a53d5aa20c83438350476d03111a704
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>


More information about the vdsm-patches mailing list