From 71f138b172e95515b9d54eee9b3e318df3381791 Mon Sep 17 00:00:00 2001 From: Yang Youseok Date: Wed, 27 Dec 2017 18:34:11 +0900 Subject: [PATCH] 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 --- openstackclient/identity/v2_0/project.py | 2 +- releasenotes/notes/bug-1740232-91ad72c2ac165f35.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-1740232-91ad72c2ac165f35.yaml diff --git a/openstackclient/identity/v2_0/project.py b/openstackclient/identity/v2_0/project.py index 04d422ecdb..9bb5fc4d08 100644 --- a/openstackclient/identity/v2_0/project.py +++ b/openstackclient/identity/v2_0/project.py @@ -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) diff --git a/releasenotes/notes/bug-1740232-91ad72c2ac165f35.yaml b/releasenotes/notes/bug-1740232-91ad72c2ac165f35.yaml new file mode 100644 index 0000000000..fb9ad7be04 --- /dev/null +++ b/releasenotes/notes/bug-1740232-91ad72c2ac165f35.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix RuntimeError in ``project show`` command running under Python 3. + [Bug `1740232 `_]