New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/643
commit f30ec1f48c499c1f74de19be88744a7fa70f5b51 Author: Eduardo Warszawski ewarszaw@redhat.com Date: Fri Jul 1 08:04:43 2011 +0300
BZ#717658 - Simplify SDF.produce()
produce() calls lookup(), lookup() calls (blockSD, localFsSD, nfsSD).findDomain(), findDomain() calls __init__(), __init__() calls findDomainPath(), findDomainPath() will return or raise StorageDomainDoesNotExist!
Never None, never a false value, no need for this check.
Change-Id: I442c368a1266855b324eab96e4a7b02634984834
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py index 1a8a3fa..883f7d2 100644 --- a/vdsm/storage/sdc.py +++ b/vdsm/storage/sdc.py @@ -73,6 +73,7 @@ class StorageDomainCache:
self._cleanStaleWeakrefs()
+ #_findDomain will raise StorageDomainDoesNotExist if sdUUID is not found in storage. dom = self._findDomain(sdUUID) self.__cache[sdUUID] = dom self.__weakCache[sdUUID] = weakref.ref(dom) diff --git a/vdsm/storage/sdf.py b/vdsm/storage/sdf.py index 58fdea0..9d09b3b 100644 --- a/vdsm/storage/sdf.py +++ b/vdsm/storage/sdf.py @@ -11,7 +11,6 @@ from config import config import logging
import sdc -import storage_exception as se
class StorageDomainFactory: @@ -34,10 +33,7 @@ class StorageDomainFactory: Produce a new Storage domain """
- newSD = cls.__sdc.lookup(sdUUID) - if not newSD: - raise se.StorageDomainDoesNotExist(sdUUID) - return newSD + return cls.__sdc.lookup(sdUUID)
@classmethod
New patch submitted by Eduardo Warszawski (ewarszaw@redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/643
commit 5650f38d078ce85f105fc5c9a8742de5938c6a85 Author: Eduardo Warszawski ewarszaw@redhat.com Date: Fri Jul 1 08:04:43 2011 +0300
BZ#717658 - Simplify SDF.produce()
produce() calls lookup(), lookup() calls (blockSD, localFsSD, nfsSD).findDomain(), findDomain() calls __init__(), __init__() calls findDomainPath(), findDomainPath() will return or raise StorageDomainDoesNotExist!
Never None, never a false value, no need for this check.
Change-Id: I442c368a1266855b324eab96e4a7b02634984834
diff --git a/vdsm/storage/sdc.py b/vdsm/storage/sdc.py index c44b58e..bf9c8df 100644 --- a/vdsm/storage/sdc.py +++ b/vdsm/storage/sdc.py @@ -86,6 +86,7 @@ class StorageDomainCache:
self._cleanStaleWeakrefs()
+ #_findDomain will raise StorageDomainDoesNotExist if sdUUID is not found in storage. dom = self._findDomain(sdUUID) self.__cache[sdUUID] = dom self.__weakCache[sdUUID] = weakref.ref(dom) diff --git a/vdsm/storage/sdf.py b/vdsm/storage/sdf.py index 6fa56f8..bd49edf 100644 --- a/vdsm/storage/sdf.py +++ b/vdsm/storage/sdf.py @@ -22,7 +22,6 @@ from config import config import logging
import sdc -import storage_exception as se
class StorageDomainFactory: @@ -45,10 +44,7 @@ class StorageDomainFactory: Produce a new Storage domain """
- newSD = cls.__sdc.lookup(sdUUID) - if not newSD: - raise se.StorageDomainDoesNotExist(sdUUID) - return newSD + return cls.__sdc.lookup(sdUUID)
@classmethod
Dan Kenigsberg has posted comments on this change.
Change subject: Simplify SDF.produce() for removing sdf.py. ......................................................................
Patch Set 3: Looks good to me, approved
-- To view, visit http://gerrit.usersys.redhat.com/643 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I442c368a1266855b324eab96e4a7b02634984834 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: Simplify SDF.produce() for removing sdf.py. ......................................................................
Patch Set 4: Verified; Looks good to me, approved
-- Gerrit-MessageType: comment Gerrit-Change-Id: I442c368a1266855b324eab96e4a7b02634984834 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: Simplify SDF.produce() for removing sdf.py. ......................................................................
-- Gerrit-MessageType: comment Gerrit-Change-Id: I442c368a1266855b324eab96e4a7b02634984834 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: Simplify SDF.produce() for removing sdf.py. ......................................................................
Simplify SDF.produce() for removing sdf.py.
produce() will return a domain or raise StorageDomainDoesNotExist. No need for this check.
Change-Id: I442c368a1266855b324eab96e4a7b02634984834 --- M vdsm/storage/sdc.py M vdsm/storage/sdf.py 2 files changed, 2 insertions(+), 5 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.usersys.redhat.com/643 To unsubscribe, visit http://gerrit.usersys.redhat.com/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I442c368a1266855b324eab96e4a7b02634984834 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