New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/642
commit d15b149a4e5adc8d5763e4ff2aa31f4d050637a6 Author: Eduardo Warszawski ewarszaw@redhat.com Date: Fri Jul 1 06:58:20 2011 +0300
BZ#717658 - Remove SDF.create()
Change-Id: I31b64def7aea87d4d3a94950abc8e96fbe3c4b8a
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index c4fa249..296e923 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -22,6 +22,8 @@ from itertools import imap import sp import sd import blockSD +import nfsSD +import localFsSD import spm import lvm import fileUtils @@ -1171,8 +1173,15 @@ class HSM:
#getSharedLock(connectionsResource...) #getExclusiveLock(sdUUID...) - SDF.create(sdUUID=sdUUID, storageType=storageType, domainName=domainName, - domClass=domClass, typeSpecificArg=typeSpecificArg, version=domVersion) + if storageType in sd.BLOCK_DOMAIN_TYPES: + newSD = blockSD.BlockStorageDomain.create(sdUUID, domainName, domClass, typeSpecificArg, storageType, domVersion) + elif storageType == sd.NFS_DOMAIN: + newSD = nfsSD.NfsStorageDomain.create(sdUUID, domainName, domClass, typeSpecificArg, storageType, domVersion) + elif storageType == sd.LOCALFS_DOMAIN: + newSD = localFsSD.LocalFsStorageDomain.create(sdUUID, domainName, domClass, typeSpecificArg, storageType, domVersion) + else: + raise se.StorageDomainTypeError(storageType) + SDF.manuallyAddDomain(newSD)
def public_validateStorageDomain(self, sdUUID, options = None): diff --git a/vdsm/storage/sdf.py b/vdsm/storage/sdf.py index 5e0577d..58fdea0 100644 --- a/vdsm/storage/sdf.py +++ b/vdsm/storage/sdf.py @@ -11,7 +11,6 @@ from config import config import logging
import sdc -import sd import storage_exception as se
@@ -20,6 +19,11 @@ class StorageDomainFactory: storage_repository = config.get('irs', 'repository') __sdc = sdc.StorageDomainCache(storage_repository)
+ #WARNING! The parameters of the following two methods are not symmetric. + @classmethod + def manuallyAddDomain(cls, sd): + cls.__sdc.manuallyAddDomain(sd) + @classmethod def manuallyRemoveDomain(cls, sdUUID): cls.__sdc.manuallyRemoveDomain(sdUUID) @@ -37,38 +41,6 @@ class StorageDomainFactory:
@classmethod - def create(cls, sdUUID, storageType, domainName, domClass, typeSpecificArg, version): - """ - Create a new Storage domain - """ - import nfsSD - import localFsSD - import blockSD - - newSD = None - if storageType in [sd.NFS_DOMAIN]: - newSD = nfsSD.NfsStorageDomain.create(sdUUID=sdUUID, - domainName=domainName, domClass=domClass, - remotePath=typeSpecificArg, storageType=storageType, - version=version) - elif storageType in [sd.LOCALFS_DOMAIN]: - newSD = localFsSD.LocalFsStorageDomain.create(sdUUID=sdUUID, - domainName=domainName, domClass=domClass, - remotePath=typeSpecificArg, storageType=storageType, - version=version) - elif storageType in [sd.ISCSI_DOMAIN, sd.FCP_DOMAIN]: - newSD = blockSD.BlockStorageDomain.create(sdUUID=sdUUID, - domainName=domainName, domClass=domClass, - vgUUID=typeSpecificArg, storageType=storageType, - version=version) - else: - raise se.StorageDomainTypeError(storageType) - - cls.__sdc.manuallyAddDomain(newSD) - return newSD - - - @classmethod def getAllUUIDs(cls): return cls.__sdc.getUUIDs()
New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/642
commit 1945cfa6f84381feaa8b6c8a001bd5df5efeeaee Author: Eduardo Warszawski ewarszaw@redhat.com Date: Fri Jul 1 06:58:20 2011 +0300
BZ#717658 - Remove SDF.create()
Change-Id: I31b64def7aea87d4d3a94950abc8e96fbe3c4b8a
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 84e688a..5d398e0 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -34,6 +34,8 @@ from collections import defaultdict import sp import sd import blockSD +import nfsSD +import localFsSD import spm import lvm import fileUtils @@ -1209,8 +1211,15 @@ class HSM:
#getSharedLock(connectionsResource...) #getExclusiveLock(sdUUID...) - SDF.create(sdUUID=sdUUID, storageType=storageType, domainName=domainName, - domClass=domClass, typeSpecificArg=typeSpecificArg, version=domVersion) + if storageType in sd.BLOCK_DOMAIN_TYPES: + newSD = blockSD.BlockStorageDomain.create(sdUUID, domainName, domClass, typeSpecificArg, storageType, domVersion) + elif storageType == sd.NFS_DOMAIN: + newSD = nfsSD.NfsStorageDomain.create(sdUUID, domainName, domClass, typeSpecificArg, storageType, domVersion) + elif storageType == sd.LOCALFS_DOMAIN: + newSD = localFsSD.LocalFsStorageDomain.create(sdUUID, domainName, domClass, typeSpecificArg, storageType, domVersion) + else: + raise se.StorageDomainTypeError(storageType) + SDF.manuallyAddDomain(newSD)
def public_validateStorageDomain(self, sdUUID, options = None): diff --git a/vdsm/storage/sdf.py b/vdsm/storage/sdf.py index c2587d8..6fa56f8 100644 --- a/vdsm/storage/sdf.py +++ b/vdsm/storage/sdf.py @@ -22,7 +22,6 @@ from config import config import logging
import sdc -import sd import storage_exception as se
@@ -31,6 +30,11 @@ class StorageDomainFactory: storage_repository = config.get('irs', 'repository') __sdc = sdc.StorageDomainCache(storage_repository)
+ #WARNING! The parameters of the following two methods are not symmetric. + @classmethod + def manuallyAddDomain(cls, sd): + cls.__sdc.manuallyAddDomain(sd) + @classmethod def manuallyRemoveDomain(cls, sdUUID): cls.__sdc.manuallyRemoveDomain(sdUUID) @@ -48,38 +52,6 @@ class StorageDomainFactory:
@classmethod - def create(cls, sdUUID, storageType, domainName, domClass, typeSpecificArg, version): - """ - Create a new Storage domain - """ - import nfsSD - import localFsSD - import blockSD - - newSD = None - if storageType in [sd.NFS_DOMAIN]: - newSD = nfsSD.NfsStorageDomain.create(sdUUID=sdUUID, - domainName=domainName, domClass=domClass, - remotePath=typeSpecificArg, storageType=storageType, - version=version) - elif storageType in [sd.LOCALFS_DOMAIN]: - newSD = localFsSD.LocalFsStorageDomain.create(sdUUID=sdUUID, - domainName=domainName, domClass=domClass, - remotePath=typeSpecificArg, storageType=storageType, - version=version) - elif storageType in [sd.ISCSI_DOMAIN, sd.FCP_DOMAIN]: - newSD = blockSD.BlockStorageDomain.create(sdUUID=sdUUID, - domainName=domainName, domClass=domClass, - vgUUID=typeSpecificArg, storageType=storageType, - version=version) - else: - raise se.StorageDomainTypeError(storageType) - - cls.__sdc.manuallyAddDomain(newSD) - return newSD - - - @classmethod def getAllUUIDs(cls): return cls.__sdc.getUUIDs()
Dan Kenigsberg has posted comments on this change.
Change subject: Remove SDF.create() for removing sdf.py ......................................................................
Patch Set 3: Looks good to me, approved
-- To view, visit http://gerrit.usersys.redhat.com/642 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I31b64def7aea87d4d3a94950abc8e96fbe3c4b8a Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Remove SDF.create() for removing sdf.py ......................................................................
Patch Set 4: Verified; Looks good to me, approved
-- Gerrit-MessageType: comment Gerrit-Change-Id: I31b64def7aea87d4d3a94950abc8e96fbe3c4b8a Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Remove SDF.create() for removing sdf.py ......................................................................
-- Gerrit-MessageType: comment Gerrit-Change-Id: I31b64def7aea87d4d3a94950abc8e96fbe3c4b8a Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Remove SDF.create() for removing sdf.py ......................................................................
Remove SDF.create() for removing sdf.py
Change-Id: I31b64def7aea87d4d3a94950abc8e96fbe3c4b8a --- M vdsm/storage/hsm.py M vdsm/storage/sdf.py 2 files changed, 19 insertions(+), 35 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.usersys.redhat.com/642 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I31b64def7aea87d4d3a94950abc8e96fbe3c4b8a Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Ayal Baron Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Eduardo Warszawski ewarszaw@redhat.com Gerrit-Reviewer: Yotam Oron yoron@redhat.com
vdsm-patches@lists.fedorahosted.org