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
This commit is contained in:
parent
a04172969a
commit
8b7a2c8d59
@ -10,6 +10,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import munch
|
||||||
|
|
||||||
|
|
||||||
def get_osc_show_columns_for_sdk_resource(
|
def get_osc_show_columns_for_sdk_resource(
|
||||||
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.
|
# Build the OSC column names to display for the SDK resource.
|
||||||
attr_map = {}
|
attr_map = {}
|
||||||
display_columns = list(resource_dict.keys())
|
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
|
invisible_columns = [] if invisible_columns is None else invisible_columns
|
||||||
for col_name in invisible_columns:
|
for col_name in invisible_columns:
|
||||||
if col_name in display_columns:
|
if col_name in display_columns:
|
||||||
|
Loading…
Reference in New Issue
Block a user