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 will be displayed directly. This is to pass kwargs to
some exceptions, to get better format of error message.

Change-Id: Ia7d0ec0152de9ee4bdf10c8de80e8d32bbf4a42b
This commit is contained in:
zhufl 2019-04-17 16:19:19 +08:00
parent f4e17a34b9
commit 74370e8c18
3 changed files with 3 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class DesignateDriver(driver.DnsDriver):
matching_record = [rec for rec in records
if rec.name == name + '.' and rec.type == type]
if not matching_record:
raise exception.DnsRecordNotFound(name)
raise exception.DnsRecordNotFound(name=name)
LOG.debug("Deleting DNS entry %s.", name)
self.dns_client.records.delete(dns_zone.id, matching_record[0].id)

View File

@ -1146,7 +1146,7 @@ class CassandraAdmin(object):
if user:
return user.databases
raise exception.UserNotFound(username)
raise exception.UserNotFound(uuid=username)
def _deserialize_keyspace(self, keyspace_dict, check_reserved=True):
if keyspace_dict:

View File

@ -654,7 +654,7 @@ class PgSqlAdmin(object):
if user is not None:
return user.databases
raise exception.UserNotFound(username)
raise exception.UserNotFound(uuid=username)
def create_database(self, context, databases):
"""Create the list of specified databases.