Remove unnecessary constructors for exceptions
They are unnecessary and end up just adding extra code Change-Id: I1aa6e7be7640dfc0e5fb05a2d662fa42d2cd82c3
This commit is contained in:
@@ -76,8 +76,7 @@ class ProcessExecutionError(IOError):
|
||||
|
||||
|
||||
class Error(Exception):
|
||||
def __init__(self, message=None):
|
||||
super(Error, self).__init__(message)
|
||||
pass
|
||||
|
||||
|
||||
class EC2APIError(Error):
|
||||
@@ -207,9 +206,6 @@ class MelangeConnectionFailed(NovaException):
|
||||
class NotAuthorized(NovaException):
|
||||
message = _("Not authorized.")
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(NotAuthorized, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class AdminRequired(NotAuthorized):
|
||||
message = _("User does not have admin privileges")
|
||||
@@ -406,9 +402,6 @@ class InvalidEc2Id(Invalid):
|
||||
class NotFound(NovaException):
|
||||
message = _("Resource could not be found.")
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(NotFound, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class FlagNotSet(NotFound):
|
||||
message = _("Required flag %(flag)s not set.")
|
||||
@@ -911,11 +904,8 @@ class ImageTooLarge(NovaException):
|
||||
message = _("Image is larger than instance type allows")
|
||||
|
||||
|
||||
class ZoneRequestError(Error):
|
||||
def __init__(self, message=None):
|
||||
if message is None:
|
||||
message = _("1 or more Zones could not complete the request")
|
||||
super(ZoneRequestError, self).__init__(message=message)
|
||||
class ZoneRequestError(NovaException):
|
||||
message = _("1 or more Zones could not complete the request")
|
||||
|
||||
|
||||
class InstanceTypeMemoryTooSmall(NovaException):
|
||||
|
Reference in New Issue
Block a user