Remove locals() from various places.
fixes bug 1171936 Remove usage of locals() for string formatting Change-Id: Ib05538095086ddefdb486c84da506af662ec5c9b
This commit is contained in:
@@ -2953,7 +2953,7 @@ def quota_reserve(context, resources, quotas, deltas, expire,
|
|||||||
|
|
||||||
if unders:
|
if unders:
|
||||||
LOG.warning(_("Change will make usage less than 0 for the following "
|
LOG.warning(_("Change will make usage less than 0 for the following "
|
||||||
"resources: %(unders)s") % locals())
|
"resources: %s"), unders)
|
||||||
if overs:
|
if overs:
|
||||||
usages = dict((k, dict(in_use=v['in_use'], reserved=v['reserved']))
|
usages = dict((k, dict(in_use=v['in_use'], reserved=v['reserved']))
|
||||||
for k, v in usages.items())
|
for k, v in usages.items())
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ def get_my_linklocal(interface):
|
|||||||
raise exception.NovaException(msg)
|
raise exception.NovaException(msg)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
msg = _("Couldn't get Link Local IP of %(interface)s"
|
msg = _("Couldn't get Link Local IP of %(interface)s"
|
||||||
" :%(ex)s") % locals()
|
" :%(ex)s") % {'interface': interface, 'ex': ex}
|
||||||
raise exception.NovaException(msg)
|
raise exception.NovaException(msg)
|
||||||
|
|
||||||
|
|
||||||
@@ -1105,12 +1105,12 @@ def check_string_length(value, name, min_length=0, max_length=None):
|
|||||||
|
|
||||||
if len(value) < min_length:
|
if len(value) < min_length:
|
||||||
msg = _("%(name)s has less than %(min_length)s "
|
msg = _("%(name)s has less than %(min_length)s "
|
||||||
"characters.") % locals()
|
"characters.") % {'name': name, 'min_length': min_length}
|
||||||
raise exception.InvalidInput(message=msg)
|
raise exception.InvalidInput(message=msg)
|
||||||
|
|
||||||
if max_length and len(value) > max_length:
|
if max_length and len(value) > max_length:
|
||||||
msg = _("%(name)s has more than %(max_length)s "
|
msg = _("%(name)s has more than %(max_length)s "
|
||||||
"characters.") % locals()
|
"characters.") % {'name': name, 'max_length': max_length}
|
||||||
raise exception.InvalidInput(message=msg)
|
raise exception.InvalidInput(message=msg)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user