summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs
diff options
context:
space:
mode:
authorNitin Goyal <nigoyal@redhat.com>2019-08-27 10:57:53 +0530
committerNitin Goyal <nigoyal@redhat.com>2019-08-27 21:19:41 +0530
commitffef7f14ef5c6d88ca8d68f9ab7b0a2319faef12 (patch)
treeaeb69a30018ded98759ba385091ee513a7a0594f /openshift-storage-libs
parent887813b694d4fb5abaa2e2180cd75e0b79c27704 (diff)
Fix error handling logic in the "vmware" cloud provider
Fix error handling logic in the "vmware" cloud provider module by adding "raise" statement in places where it is lost. Change-Id: I92e97da4109bc6ab7368b41d2a6886e9f2be31c1
Diffstat (limited to 'openshift-storage-libs')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/cloundproviders/vmware.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/cloundproviders/vmware.py b/openshift-storage-libs/openshiftstoragelibs/cloundproviders/vmware.py
index 8312efa..fe69b53 100644
--- a/openshift-storage-libs/openshiftstoragelibs/cloundproviders/vmware.py
+++ b/openshift-storage-libs/openshiftstoragelibs/cloundproviders/vmware.py
@@ -196,12 +196,12 @@ class VmWare(object):
if not vm:
msg = 'VM %s is not present in list' % vm_name
g.log.error(msg)
- exceptions.CloudProviderError(msg)
+ raise exceptions.CloudProviderError(msg)
if vm[0].summary.runtime.powerState == 'poweredOn':
msg = 'VM %s is already powered On' % vm_name
g.log.error(msg)
- exceptions.CloudProviderError(msg)
+ raise exceptions.CloudProviderError(msg)
tasks = [vm[0].PowerOn()]
self._wait_for_tasks(tasks, self.vsphere_client)
@@ -226,12 +226,12 @@ class VmWare(object):
if not vm:
msg = 'VM %s is not present in list' % vm_name
g.log.error(msg)
- exceptions.CloudProviderError(msg)
+ raise exceptions.CloudProviderError(msg)
if vm[0].summary.runtime.powerState == 'poweredOff':
msg = 'VM %s is already powered Off' % vm_name
g.log.error(msg)
- exceptions.CloudProviderError(msg)
+ raise exceptions.CloudProviderError(msg)
tasks = [vm[0].PowerOff()]
self._wait_for_tasks(tasks, self.vsphere_client)