Skip to content

Commit 8b7a2c8

Browse files
committed
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
1 parent a041729 commit 8b7a2c8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

openstackclient/network/sdk_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13+
import munch
14+
1315

1416
def get_osc_show_columns_for_sdk_resource(
1517
sdk_resource,
@@ -38,6 +40,9 @@ def get_osc_show_columns_for_sdk_resource(
3840
# Build the OSC column names to display for the SDK resource.
3941
attr_map = {}
4042
display_columns = list(resource_dict.keys())
43+
for col_name in display_columns:
44+
if isinstance(resource_dict[col_name], munch.Munch):
45+
display_columns.remove(col_name)
4146
invisible_columns = [] if invisible_columns is None else invisible_columns
4247
for col_name in invisible_columns:
4348
if col_name in display_columns:

0 commit comments

Comments
 (0)