summaryrefslogtreecommitdiff
path: root/oslo_vmware/api.py
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem@us.ibm.com>2015-05-26 21:32:40 +0000
committerMatt Riedemann <mriedem@us.ibm.com>2015-05-26 21:32:40 +0000
commit8ec7f0fe044340b8544589e3295b70b6390f55a2 (patch)
treeae82807aec52d65a17eed69cc58b9ed0f013f71b /oslo_vmware/api.py
parent1668fef9cabea6a23023aab6b97617b4368b14d6 (diff)
downloadoslo-vmware-8ec7f0fe044340b8544589e3295b70b6390f55a2.tar.gz
Revert "Raise VimFaultException for unknown faults"
This reverts commit 1668fef9cabea6a23023aab6b97617b4368b14d6 This is a backwards incompatible change, as we see with the nova driver code that is expecting a VMwareDriverException but is now getting back a VimFaultException because the unit tests in nova were passing an unknown fault class name. Change-Id: I0f8042c6e47f6eb9802e770ffb7d09bdbe57013b Closes-Bug: #1459021
Diffstat (limited to 'oslo_vmware/api.py')
-rw-r--r--oslo_vmware/api.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/oslo_vmware/api.py b/oslo_vmware/api.py
index dabc461..df68bc9 100644
--- a/oslo_vmware/api.py
+++ b/oslo_vmware/api.py
@@ -321,8 +321,7 @@ class VMwareAPISession(object):
LOG.debug("Fault list: %s", excep.fault_list)
fault = excep.fault_list[0]
clazz = exceptions.get_fault_class(fault)
- if clazz:
- raise clazz(six.text_type(excep), excep.details)
+ raise clazz(six.text_type(excep), excep.details)
raise
except exceptions.VimConnectionException:
@@ -414,12 +413,7 @@ class VMwareAPISession(object):
error_msg = six.text_type(task_info.error.localizedMessage)
error = task_info.error
name = error.fault.__class__.__name__
- fault_class = exceptions.get_fault_class(name)
- if fault_class:
- task_ex = fault_class(error_msg)
- else:
- task_ex = exceptions.VimFaultException([name],
- error_msg)
+ task_ex = exceptions.get_fault_class(name)(error_msg)
raise task_ex
def wait_for_lease_ready(self, lease):