Fix reraising of exceptions
Exceptions should be reraised with just "raise" and not "raise e" to preserve the traceback. This also addresses a couple cases where the catching and reraising of the exception was not actually doing anything. Change-Id: I94ba193f728ee7ca6f689f70fc08317a1dd50c92 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
parent
30104ae4ae
commit
af0f02d19b
@ -131,11 +131,8 @@ class BaseAction(loadable.Loadable):
|
|||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def validate_parameters(self):
|
def validate_parameters(self):
|
||||||
try:
|
jsonschema.validate(self.input_parameters, self.schema)
|
||||||
jsonschema.validate(self.input_parameters, self.schema)
|
return True
|
||||||
return True
|
|
||||||
except jsonschema.ValidationError as e:
|
|
||||||
raise e
|
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def get_description(self):
|
def get_description(self):
|
||||||
|
@ -109,11 +109,8 @@ class VolumeMigrate(base.BaseAction):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def validate_parameters(self):
|
def validate_parameters(self):
|
||||||
try:
|
jsonschema.validate(self.input_parameters, self.schema)
|
||||||
jsonschema.validate(self.input_parameters, self.schema)
|
return True
|
||||||
return True
|
|
||||||
except jsonschema.ValidationError as e:
|
|
||||||
raise e
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def volume_id(self):
|
def volume_id(self):
|
||||||
|
@ -59,7 +59,7 @@ class IndicatorSpecification(object):
|
|||||||
jsonschema.validate(value, cls.schema)
|
jsonschema.validate(value, cls.schema)
|
||||||
except (SchemaError, ValidationError) as exc:
|
except (SchemaError, ValidationError) as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
raise exc
|
raise
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
raise exception.InvalidIndicatorValue(
|
raise exception.InvalidIndicatorValue(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user