Remove shadow BaseException class
The BaseException class defined in exceptions.py is shadowing the built-in BaseException class of the Python exception hierarchy, which could potentially cause confusion. This removes the BaseException definition and replaces it with the existing WatcherException object. Instantiations of the IllegalArgumentException are also changed to use the message kwarg. Change-Id: I20abf135805c7a354924de8a5194b59fc040460a Closes-Bug: #1535504
This commit is contained in:
@@ -34,12 +34,12 @@ class ModelRoot(object):
|
||||
def assert_hypervisor(self, obj):
|
||||
if not isinstance(obj, hypervisor.Hypervisor):
|
||||
raise exception.IllegalArgumentException(
|
||||
_("'obj' argument type is not valid"))
|
||||
message=_("'obj' argument type is not valid"))
|
||||
|
||||
def assert_vm(self, obj):
|
||||
if not isinstance(obj, vm.VM):
|
||||
raise exception.IllegalArgumentException(
|
||||
_("'obj' argument type is not valid"))
|
||||
message=_("'obj' argument type is not valid"))
|
||||
|
||||
def add_hypervisor(self, hypervisor):
|
||||
self.assert_hypervisor(hypervisor)
|
||||
|
||||
Reference in New Issue
Block a user