summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJens Harbott <j.harbott@x-ion.de>2019-08-30 13:15:22 +0000
committerJens Harbott <j.harbott@x-ion.de>2020-06-17 10:09:36 +0000
commit8b7a2c8d5931f15b69d1ef6baad994f4b9904579 (patch)
tree3ffb7507cecbd2ab3ef2791a68f650939bc5044b /openstackclient
parenta04172969a5e440af50127dfd27a80a6beb7ddb8 (diff)
downloadpython-openstackclient-8b7a2c8d5931f15b69d1ef6baad994f4b9904579.tar.gz
Don't display Munch objects in the output
When the sdk gives us a resource that contains Munch columns, drop them from the output as they are for programmatic usage only and have no use in a CLI context. Change-Id: Idd7306cd763b5a017a66e410e70e1adb02663c2a
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/network/sdk_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/openstackclient/network/sdk_utils.py b/openstackclient/network/sdk_utils.py
index af9c74f9..cff30713 100644
--- a/openstackclient/network/sdk_utils.py
+++ b/openstackclient/network/sdk_utils.py
@@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import munch
+
def get_osc_show_columns_for_sdk_resource(
sdk_resource,
@@ -38,6 +40,9 @@ def get_osc_show_columns_for_sdk_resource(
# Build the OSC column names to display for the SDK resource.
attr_map = {}
display_columns = list(resource_dict.keys())
+ for col_name in display_columns:
+ if isinstance(resource_dict[col_name], munch.Munch):
+ display_columns.remove(col_name)
invisible_columns = [] if invisible_columns is None else invisible_columns
for col_name in invisible_columns:
if col_name in display_columns: