Fix for KeyError during config preparation

In this context, res has keys ['network', 'subnets', 'routers'] -
it looks like the correct reference should be res["network"]["name"]

Change-Id: I343a582c2ebed729cddebcb6ae8c660c29fec221
Closes-Bug: 1888866
This commit is contained in:
Stig Telfer 2020-07-25 21:14:59 +01:00
parent 4c207ae082
commit 5949387949
1 changed files with 2 additions and 1 deletions

View File

@ -154,7 +154,8 @@ class TempestContext(context.VerifierContext):
if helper_method:
res = helper_method(*args, **kwargs)
if res:
value = res["name"] if "network" in option else res.id
value = res["network"]["name"] if ("network" in
option) else res.id
LOG.debug("Setting value '%s' to option '%s'." % (value, option))
self.conf.set(section, option, value)
LOG.debug("Option '{opt}' is configured. "