From 8b7a2c8d5931f15b69d1ef6baad994f4b9904579 Mon Sep 17 00:00:00 2001
From: Jens Harbott <j.harbott@x-ion.de>
Date: Fri, 30 Aug 2019 13:15:22 +0000
Subject: [PATCH] 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
---
 openstackclient/network/sdk_utils.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/openstackclient/network/sdk_utils.py b/openstackclient/network/sdk_utils.py
index af9c74f944..cff3071354 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: