Skip to content

Commit 71f138b

Browse files
XeiteDean Troyer
authored andcommitted
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
1 parent 8c5f755 commit 71f138b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

openstackclient/identity/v2_0/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def take_action(self, parsed_args):
289289
# the API has and handle the extra top level properties.
290290
reserved = ('name', 'id', 'enabled', 'description')
291291
properties = {}
292-
for k, v in info.items():
292+
for k, v in list(info.items()):
293293
if k not in reserved:
294294
# If a key is not in `reserved` it's a property, pop it
295295
info.pop(k)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
Fix RuntimeError in ``project show`` command running under Python 3.
5+
[Bug `1740232 <https://bugs.launchpad.net/python-openstackclient/+bug/1740232>`_]

0 commit comments

Comments
 (0)