Traceback (most recent call last):
File "/home/ubuntu/tempest2/.tox/py310/lib/python3.10/site-packages/tempest/cmd/cleanup.py", line 155, in take_action
self._cleanup()
File "/home/ubuntu/tempest2/.tox/py310/lib/python3.10/site-packages/tempest/cmd/cleanup.py", line 255, in _cleanup
svc.run()
File "/home/ubuntu/tempest2/.tox/py310/lib/python3.10/site-packages/tempest/cmd/cleanup_service.py", line 150, in run
self.dry_run()
File "/home/ubuntu/tempest2/.tox/py310/lib/python3.10/site-packages/tempest/cmd/cleanup_service.py", line 323, in dry_run
keypairs = self.list()
File "/home/ubuntu/tempest2/.tox/py310/lib/python3.10/site-packages/tempest/cmd/cleanup_service.py", line 298, in list
keypairs = self._filter_by_prefix(keypairs['keypair'])
TypeError: list indices must be integers or slices, not str
btw, there is a bug in listing of keypairs if --prefix is passed
client. list_keypairs here: https:/ /opendev. org/openstack/ tempest/ src/commit/ 6618aa253e04b88 79ae6d721a48ee4 851543ba4a/ tempest/ cmd/cleanup_ service. py#L294
returns something like this:
[{'keypair': {'name': 'my_test', 'public_key': 'ssh-ed25519 AAAAC3NzaC1lZDI 1NTE5AAAAIL4FIB Thf0PJRMrGFRYoI toGoUEoS7eZ15aB B2N5SB0G' , 43:71:d5: c1:32:7a: 9c:25:95: 17:42:5f: 2a:e4'} }, {'keypair': {'name': 'my_test_2', 'public_key': 'ssh-ed25519 1NTE5AAAAIPrH86 oiqlP+i/ bCs5BxiwT6WI7k9 wUEzDnFPoMtDSY9 ', 'fingerprint': '7a:51: 78:fc:f9: dd:ce:da: e5:b9:db: 6d:58:82: 8d:d3'} }]
'fingerprint': '9d:21:
AAAAC3NzaC1lZDI
it's a list with dicts containing {'keypair': <details in a dict>} .. and therefore it fails couple lines below on this line: https:/ /opendev. org/openstack/ tempest/ src/commit/ 6618aa253e04b88 79ae6d721a48ee4 851543ba4a/ tempest/ cmd/cleanup_ service. py#L297
with:
Traceback (most recent call last): ubuntu/ tempest2/ .tox/py310/ lib/python3. 10/site- packages/ tempest/ cmd/cleanup. py", line 155, in take_action ubuntu/ tempest2/ .tox/py310/ lib/python3. 10/site- packages/ tempest/ cmd/cleanup. py", line 255, in _cleanup ubuntu/ tempest2/ .tox/py310/ lib/python3. 10/site- packages/ tempest/ cmd/cleanup_ service. py", line 150, in run ubuntu/ tempest2/ .tox/py310/ lib/python3. 10/site- packages/ tempest/ cmd/cleanup_ service. py", line 323, in dry_run ubuntu/ tempest2/ .tox/py310/ lib/python3. 10/site- packages/ tempest/ cmd/cleanup_ service. py", line 298, in list by_prefix( keypairs[ 'keypair' ])
File "/home/
self._cleanup()
File "/home/
svc.run()
File "/home/
self.dry_run()
File "/home/
keypairs = self.list()
File "/home/
keypairs = self._filter_
TypeError: list indices must be integers or slices, not str