diff --git a/muranodashboard/environments/topology.py b/muranodashboard/environments/topology.py index 79a79be37..ac633d38e 100644 --- a/muranodashboard/environments/topology.py +++ b/muranodashboard/environments/topology.py @@ -141,6 +141,14 @@ def _create_ext_network_node(name): return node +def _convert_lists(node_data): + for key, value in six.iteritems(node_data): + if isinstance(value, list) and all( + map(lambda s: not isinstance(s, (dict, list)), value)): + new_value = ', '.join(str(v) for v in value) + node_data[key] = new_value + + def _split_seq_by_predicate(seq, predicate): holds, not_holds = [], [] for elt in seq: @@ -193,6 +201,7 @@ def render_d3_data(request, environment): def rec(node_data, node_key, parent_node=None): if not isinstance(node_data, dict): return + _convert_lists(node_data) node_type = node_data.get('?', {}).get('type') node_id = node_data.get('?', {}).get('id') atomics, containers = _split_seq_by_predicate( diff --git a/releasenotes/notes/ips-display-topology-5a45876dafc637eb.yaml b/releasenotes/notes/ips-display-topology-5a45876dafc637eb.yaml new file mode 100644 index 000000000..4e68fede0 --- /dev/null +++ b/releasenotes/notes/ips-display-topology-5a45876dafc637eb.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - VM IP addresses are now properly displayed in the environment topology + viewer.