Pass kwargs to exception to get better format of error message
If we do not pass kwargs to exception, the parameter will be deemed as message and msg_fmt is ignored, so the message will be displayed directly. This is to pass kwargs to some exceptions, to get better format of error message. Change-Id: I66677a90430d9e6699619539cb8f575f57b19433
This commit is contained in:
parent
9b2a7f9e7c
commit
40cbea18e6
|
@ -47,7 +47,7 @@ def block_db_access(service_name):
|
|||
LOG.error('No db access allowed in %(service_name)s: '
|
||||
'%(stacktrace)s',
|
||||
dict(service_name=service_name, stacktrace=stacktrace))
|
||||
raise exception.DBNotAllowed(service_name)
|
||||
raise exception.DBNotAllowed(binary=service_name)
|
||||
|
||||
nova.db.api.IMPL = NoDB()
|
||||
|
||||
|
|
|
@ -1788,7 +1788,7 @@ def instance_destroy(context, instance_uuid, constraint=None):
|
|||
if uuidutils.is_uuid_like(instance_uuid):
|
||||
instance_ref = _instance_get_by_uuid(context, instance_uuid)
|
||||
else:
|
||||
raise exception.InvalidUUID(instance_uuid)
|
||||
raise exception.InvalidUUID(uuid=instance_uuid)
|
||||
|
||||
query = model_query(context, models.Instance).\
|
||||
filter_by(uuid=instance_uuid)
|
||||
|
@ -2772,7 +2772,7 @@ def _instance_metadata_update_in_place(context, instance, metadata_type, model,
|
|||
|
||||
def _instance_update(context, instance_uuid, values, expected, original=None):
|
||||
if not uuidutils.is_uuid_like(instance_uuid):
|
||||
raise exception.InvalidUUID(instance_uuid)
|
||||
raise exception.InvalidUUID(uuid=instance_uuid)
|
||||
|
||||
if expected is None:
|
||||
expected = {}
|
||||
|
|
Loading…
Reference in New Issue