Fix RuntimeError when showing project which has extra properties
If you use python3, items() returns iterator which is not allowed to remove item during iteration. Fix to iterate by copied list. Change-Id: I64c037d04e2b127d8f19f56cab65122af89a7200 Closes-Bug: 1740232
This commit is contained in:
parent
8c5f755569
commit
71f138b172
@ -289,7 +289,7 @@ class ShowProject(command.ShowOne):
|
||||
# the API has and handle the extra top level properties.
|
||||
reserved = ('name', 'id', 'enabled', 'description')
|
||||
properties = {}
|
||||
for k, v in info.items():
|
||||
for k, v in list(info.items()):
|
||||
if k not in reserved:
|
||||
# If a key is not in `reserved` it's a property, pop it
|
||||
info.pop(k)
|
||||
|
5
releasenotes/notes/bug-1740232-91ad72c2ac165f35.yaml
Normal file
5
releasenotes/notes/bug-1740232-91ad72c2ac165f35.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fix RuntimeError in ``project show`` command running under Python 3.
|
||||
[Bug `1740232 <https://bugs.launchpad.net/python-openstackclient/+bug/1740232>`_]
|
Loading…
Reference in New Issue
Block a user