Liron Aravot has uploaded a new change for review.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
core: moving InquireNotSupportedError to storage_exception.py
InquireNotSupportedError is currently defined in clusterlock.py, that prohibits from assigning a meaningful error code to that error and to use it outside of that class scope without using a different method then our wildly used one. In this patch its moved to storage_exception so we'll be able catch and inspect that error like any other clusterlock related error. The engine will use that error as well and will attempt to start the spm if getSpmStatus() will fail as we don't have the "current" spm information, on the worst case startSpm() will fail.
Change-Id: I8201794dc96ee24dc9c0da5b7c3d71ab0b75e9f3 Bug-Url: https://bugzilla.redhat.com/1242092 Signed-off-by: Liron Aravot laravot@redhat.com --- M vdsm/storage/clusterlock.py M vdsm/storage/hsm.py M vdsm/storage/storage_exception.py 3 files changed, 10 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/45975/1
diff --git a/vdsm/storage/clusterlock.py b/vdsm/storage/clusterlock.py index 24a5d81..7373e1f 100644 --- a/vdsm/storage/clusterlock.py +++ b/vdsm/storage/clusterlock.py @@ -69,10 +69,6 @@ HOST_STATUS_DEAD = "dead"
-class InquireNotSupportedError(Exception): - """Raised when the clusterlock class is not supporting inquire""" - - class SafeLease(object): log = logging.getLogger("Storage.SafeLease")
@@ -146,7 +142,7 @@ self.log.debug("Clustered lock acquired successfully")
def inquire(self): - raise InquireNotSupportedError() + raise se.InquireNotSupportedError()
def getLockUtilFullPath(self): return os.path.join(self.lockUtilPath, self.lockCmd) diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index 579f5a6..57063f1 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -635,6 +635,10 @@ # This happens when we cannot read the MD LV self.log.error("Can't read LV based metadata", exc_info=True) raise se.StorageDomainMasterError("Can't read LV based metadata") + except se.InquireNotSupportedError: + self.log.error("Inquire spm status isn't supported by " + "the current cluster lock") + raise except se.StorageException as e: self.log.error("MD read error: %s", str(e), exc_info=True) raise se.StorageDomainMasterError("MD read error") diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py index b4f3b66..5a26402 100644 --- a/vdsm/storage/storage_exception.py +++ b/vdsm/storage/storage_exception.py @@ -1593,6 +1593,11 @@ message = "Could not initialize cluster lock"
+class InquireNotSupportedError(StorageException): + code = 702 + message = "Cluster lock inquire isnt supported" + + ################################################# # Meta data related Exceptions #################################################
automation@ovirt.org has posted comments on this change.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
Patch Set 1: Verified-1
* Update tracker::#1242092::OK * Check Bug-Url::OK * Check Public Bug::#1242092::OK, public bug * Check Product::#1242092::OK, Correct product Red Hat Enterprise Virtualization Manager * Check TR::#1242092::OK, correct target release 3.5.5 * Check merged to previous::WARN, Still open on branches ovirt-3.6, master
Liron Aravot has posted comments on this change.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
Patch Set 1: Verified+1
Nir Soffer has posted comments on this change.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
Patch Set 1: Code-Review+1
Francesco Romani has posted comments on this change.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
Patch Set 1: Code-Review+2
automation@ovirt.org has posted comments on this change.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
Patch Set 2:
* Update tracker::#1269411::OK * Check Bug-Url::OK * Check Public Bug::#1269411::OK, public bug * Check Product::#1269411::OK, Correct product Red Hat Enterprise Virtualization Manager * Check TM::#1269411::OK, correct target milestone ovirt-3.5.6 * Check merged to previous::OK, change not open on any previous branch
Francesco Romani has posted comments on this change.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
Patch Set 2: Continuous-Integration+1
Francesco Romani has submitted this change and it was merged.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
core: moving InquireNotSupportedError to storage_exception.py
InquireNotSupportedError is currently defined in clusterlock.py, that prohibits from assigning a meaningful error code to that error and to use it outside of that class scope without using a different method then our wildly used one. In this patch its moved to storage_exception so we'll be able catch and inspect that error like any other clusterlock related error. The engine will use that error as well and will attempt to start the spm if getSpmStatus() will fail as we don't have the "current" spm information, on the worst case startSpm() will fail.
Change-Id: I8201794dc96ee24dc9c0da5b7c3d71ab0b75e9f3 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1269411 Signed-off-by: Liron Aravot laravot@redhat.com Reviewed-on: https://gerrit.ovirt.org/45975 Reviewed-by: Nir Soffer nsoffer@redhat.com Reviewed-by: Francesco Romani fromani@redhat.com Continuous-Integration: Francesco Romani fromani@redhat.com --- M vdsm/storage/clusterlock.py M vdsm/storage/hsm.py M vdsm/storage/storage_exception.py 3 files changed, 10 insertions(+), 5 deletions(-)
Approvals: Nir Soffer: Looks good to me, but someone else must approve Francesco Romani: Looks good to me, approved; Passed CI tests Liron Aravot: Verified
automation@ovirt.org has posted comments on this change.
Change subject: core: moving InquireNotSupportedError to storage_exception.py ......................................................................
Patch Set 3:
* Update tracker::#1269411::OK * Set MODIFIED::bug 1269411::::#1269411::::IGNORE, not oVirt prod but Red Hat Enterprise Virtualization Manager
vdsm-patches@lists.fedorahosted.org