Fix string formatting in api/metadata/vendordata_json.py

The string format should be "%(logprefix)s", add the missing "s" in one
case.

The strings currently do not include a space after the "s" which
confuses translators.  Add the space and remove it from logprefix.

Change-Id: I6b3113e184c9c3cee1e2ebe448655c7488efb61b
Closes-Bug: #1496273
This commit is contained in:
Andreas Jaeger 2015-09-16 09:50:41 +02:00
parent fe1d118c0c
commit 1fa0afb834
1 changed files with 4 additions and 4 deletions

View File

@ -37,21 +37,21 @@ class JsonFileVendorData(base.VendorDataDriver):
super(JsonFileVendorData, self).__init__(*args, **kwargs)
data = {}
fpath = CONF.vendordata_jsonfile_path
logprefix = "%s[%s]: " % (file_opt.name, fpath)
logprefix = "%s[%s]:" % (file_opt.name, fpath)
if fpath:
try:
with open(fpath, "r") as fp:
data = jsonutils.load(fp)
except IOError as e:
if e.errno == errno.ENOENT:
LOG.warning(_LW("%(logprefix)sfile does not exist"),
LOG.warning(_LW("%(logprefix)s file does not exist"),
{'logprefix': logprefix})
else:
LOG.warning(_LW("%(logprefix)unexpected IOError when "
LOG.warning(_LW("%(logprefix)s unexpected IOError when "
"reading"), {'logprefix': logprefix})
raise e
except ValueError:
LOG.warning(_LW("%(logprefix)sfailed to load json"),
LOG.warning(_LW("%(logprefix)s failed to load json"),
{'logprefix': logprefix})
raise