New patch submitted by Eduardo Warszawski (ewarszaw(a)redhat.com)
You can review this change at:
http://gerrit.usersys.redhat.com/643
commit f30ec1f48c499c1f74de19be88744a7fa70f5b51
Author: Eduardo Warszawski <ewarszaw(a)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