KeyError: 'name' in test network resources
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Rally |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I see this exception on test startup:
2020-07-24 14:23:03.656 16238 CRITICAL rally [-] Unhandled error: KeyError: 'name'
2020-07-24 14:23:03.656 16238 ERROR rally Traceback (most recent call last):
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally sys.exit(main())
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally return cliutils.
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally ret = fn(*fn_args, **fn_kwargs)
2020-07-24 14:23:03.656 16238 ERROR rally File "<decorator-
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally return f(*args, **kwargs)
2020-07-24 14:23:03.656 16238 ERROR rally File "<decorator-
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally return f(*args, **kwargs)
2020-07-24 14:23:03.656 16238 ERROR rally File "<decorator-
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally return f(*args, **kwargs)
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally tags=tags, **run_args)
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally with vcontext.
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally self.setup()
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally ctx.setup()
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally helper_
2020-07-24 14:23:03.656 16238 ERROR rally File "/home/
2020-07-24 14:23:03.656 16238 ERROR rally value = res["name"] if "network" in option else res.id
2020-07-24 14:23:03.656 16238 ERROR rally KeyError: 'name'
2020-07-24 14:23:03.656 16238 ERROR rally
Here's the code:
154 if helper_method:
155 res = helper_
156 if res:
157 import pdb; pdb.set_trace()
158 -> value = res["name"] if "network" in option else res.id
159 LOG.debug("Setting value '%s' to option '%s'." % (value, option))
The value of 'option' is 'fixed_
In this context, res has keys ['network', 'subnets', 'routers'] - it looks like the correct reference should be res["network"
Reviewed: https:/ /review. opendev. org/743044 /git.openstack. org/cgit/ openstack/ rally-openstack /commit/ ?id=59493879491 f5d37282789e26b ab2ac13afe14f7
Committed: https:/
Submitter: Zuul
Branch: master
commit 59493879491f5d3 7282789e26bab2a c13afe14f7
Author: Stig Telfer <email address hidden>
Date: Sat Jul 25 21:14:59 2020 +0100
Fix for KeyError during config preparation
In this context, res has keys ['network', 'subnets', 'routers'] - ]["name" ]
it looks like the correct reference should be res["network"
Change-Id: I343a582c2ebed7 29cddebcb6ae8c6 60c29fec221
Closes-Bug: 1888866