Jiří Moskovčák has uploaded a new change for review. Change subject: don't use vdsm backend when there is not valid vol or imgUUID ......................................................................
don't use vdsm backend when there is not valid vol or imgUUID Change-Id: Idcd181d260f4f20676a4124b899575b42935753c Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1171452 Signed-off-by: Jiri Moskovcak <[email protected]> --- M ovirt_hosted_engine_ha/agent/hosted_engine.py M ovirt_hosted_engine_ha/lib/storage_backends.py 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-ha refs/changes/74/36174/1 diff --git a/ovirt_hosted_engine_ha/agent/hosted_engine.py b/ovirt_hosted_engine_ha/agent/hosted_engine.py index 589446d..2f717d1 100644 --- a/ovirt_hosted_engine_ha/agent/hosted_engine.py +++ b/ovirt_hosted_engine_ha/agent/hosted_engine.py @@ -423,7 +423,7 @@ ).dump() } # check if we have all the needed config params needed for vdsm api - if [v for k, v in storage_params.items() if v is '']: + if any(v in ('None', None, '') for v in storage_params.values()): storage_params = { 'sd_uuid': sd_uuid, 'dom_type': dom_type diff --git a/ovirt_hosted_engine_ha/lib/storage_backends.py b/ovirt_hosted_engine_ha/lib/storage_backends.py index cf88d67..4d6b24a 100644 --- a/ovirt_hosted_engine_ha/lib/storage_backends.py +++ b/ovirt_hosted_engine_ha/lib/storage_backends.py @@ -147,6 +147,8 @@ __slots__ = ["image_uuid", "volume_uuid", "path"] def __init__(self, image_uuid, volume_uuid, path=None): + if any(k in (None, "None", "") for k in (image_uuid, volume_uuid)): + raise ValueError("image_uuid or volume_uuid is missing or None") self.image_uuid = image_uuid self.volume_uuid = volume_uuid self.path = path -- To view, visit http://gerrit.ovirt.org/36174 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcd181d260f4f20676a4124b899575b42935753c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-hosted-engine-ha Gerrit-Branch: ovirt-hosted-engine-ha-1.2 Gerrit-Owner: Jiří Moskovčák <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
