12 Commits

Author SHA1 Message Date
Davanum Srinivas
d388c8a67b Fix exception to string in py34
python 3.4 does not have a self.message, so we need to set one up
in our own base class so the conversion to string work.

Change-Id: I5d963125ccb5cc29fa0563313d229046a81ca3d0
2015-06-28 11:03:54 -04:00
Gary Kotton
c4680ba543 Add in support for ManagedObjectNotFound exception
Adds in support for propogating this exception to the user of the
oslo.vmware code.

Change-Id: I8b475a2e2e6df09554077b9bf3a5fb58bd2a5926
2015-06-22 00:22:52 -07:00
Vipin Balachandran
cd1982a528 Deprecate unused exceptions
Deprecate the following unused exceptions:
* VMwareDriverConfigurationException
* UseLinkedCloneConfigurationFault
* MissingParameter

The above exceptions are specific to VMware Nova driver and
should be moved to Nova code base.

Change-Id: I74482d6ac436fbea4383a197f24704bc3d033076
2015-06-19 17:58:47 +05:30
Vipin Balachandran
5cb43a9bb7 Raise VimFaultException for unknown faults
Currently VMwareDriverException is raised for unknown
VIM faults. Sometimes clients may need to handle such
faults. Therefore it is better if we throw
VimFaultException with the fault_list set to the relevant
VIM fault class name.

Change-Id: I97d93ceaa82514d029fff87f1c5ad942895d8940
2015-06-19 17:58:18 +05:30
Vipin Balachandran
084f547583 Exception hierarchy refactoring
There are two roots for the current exception hierarchy: VimException
and VMwareDriverException, which is not a good design. This patch
refactors the exception hierarchy to fix this problem.

Summary of changes:
* Change parent of VimException to VMwareDriverException
* Change parent of exceptions corresponding to known VIM faults
  to VimException
* Change parent of VimSessionOverLoadException, VimConnectionException,
  VimAttributeException and ImageTransferException to
  VMwareDriverException.

The guidelines followed for this refactoring are:
* The changes in existing driver code should be NIL.

* The changes in other parts of the library should be minimal.

* Any exception raised by invocation of vim APIs should be a VimException
  and any exception raised by pbm APIs should be a PbmException. But this
  will result in lot of changes in the library as well as existing clients.
  Therefore, we  define a single root for these two types of exceptions which
  is labeled as VimException.

* Any exception raised by the library should be a child of
  VMwareDriverException. Therefore, VimException, VimSessionOverLoadException,
  VimConnectionException, VimAttributeException and ImageTransferException
  are children of VMwareDriverException. Ideally, VMwareDriverException
  should be renamed as ServiceException, but it will result in backward
  incompatibility.

Change-Id: Ide1bf891be78766e8670f8446792e3dc9c7ec88f
2015-06-19 17:29:47 +05:30
Jenkins
e059a3e4e6 Merge "Revert "Raise VimFaultException for unknown faults"" 2015-05-28 09:31:11 +00:00
Matt Riedemann
8ec7f0fe04 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
2015-05-26 21:32:40 +00:00
Eric Brown
5df9daa5a3 Add ToolsUnavailable exception
Some API calls that depend on VMware Tools will return a
ToolsUnavailable fault such as ShutdownGuest. This patch adds the
new fault so that callers can catch this specific fault rather
than the general one.

Change-Id: Ibe132e54dd84e12d01e32528824e6db8ec785b52
2015-05-12 20:31:01 -07:00
Vipin Balachandran
1668fef9ca Raise VimFaultException for unknown faults
Currently VMwareDriverException is raised for unknown
VIM faults. Sometimes clients may need to handle such
faults. Therefore it is better if we throw
VimFaultException with the fault_list set to the relevant
VIM fault class name.

Change-Id: I34f84f3ea3f5f0d6878f1d4438cf25bf22f293fd
2015-04-30 12:10:29 +05:30
Vipin Balachandran
c338f19f84 Add NoDiskSpaceException
vSphere APIs such as ExtendVirtualDisk_Task, CopyVirtualDisk_Task
throw NoDiskSpace fault when there is insufficient datastore
space. Currently, VMwareDriverException is thrown by oslo.vmware in
response to NoDiskSpace VIM fault. This patch adds a new exception
class corresponding to NoDiskSpace fault.

Change-Id: I50c5a93aae7fa2b5ad29951eec4d5a07e4f02045
2015-04-27 14:53:20 +05:30
Vipin Balachandran
b5732b2e35 Handle SPBM SecurityError
SPBM APIs throw SecurityError on session expiry. Currently
it is unhandled which could result in session reconnection
failure. This patch fixes it.

Change-Id: Ibbd534464c73cc8afc30ba6ff29b46f9287a83c6
2015-02-13 20:21:45 +05:30
Doug Hellmann
48771e6bfd Move files out of the namespace package
Move the public API out of oslo.vmware to oslo_vmware. Retain the ability
to import from the old namespace package for backwards compatibility
for this release cycle.

bp/drop-namespace-packages

Change-Id: I11cf038c3832a7357ed53363d8ccf143daddd2a2
2015-01-12 13:22:13 -05:00