From 65f14e5d794b6e0c6fc456fdc6e973d206844b94 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Fri, 30 Nov 2018 01:04:53 +0900 Subject: [PATCH] Instance: show network info even if name is empty Previously, when a network name is an empty string, network information of server interfaces will be empty, so we cannot distinguish server interfaces. Also network name in the instance detail page is capitalized but there is no need to capitalize it and such information like network name should be displayed as-is. This is not directly related to the bug fixed by this commit, but it is simple enough and related to network name, so I believe it is okay. Change-Id: I2f2ad9b6bf50a2b53e79e4929d877111f875bd5b Closes-Bug: #1805812 --- openstack_dashboard/api/neutron.py | 3 ++- .../instances/templates/instances/_detail_overview.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/api/neutron.py b/openstack_dashboard/api/neutron.py index e62b12c4c8..f166716dac 100644 --- a/openstack_dashboard/api/neutron.py +++ b/openstack_dashboard/api/neutron.py @@ -1735,7 +1735,8 @@ def servers_update_addresses(request, servers, all_tenants=False): ports_floating_ips[fip.port_id].append(fip) # Map network id to its name - network_names = dict(((network.id, network.name) for network in networks)) + network_names = dict((network.id, network.name_or_id) + for network in networks) for server in servers: try: diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html index ab336a8ba3..4498bc9352 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html @@ -69,7 +69,7 @@
{% for network, ip_list in instance.addresses.items %} -
{{ network|title }}
+
{{ network }}
{% for ip in ip_list %} {% if not forloop.last %}{{ ip.addr }}, {% else %}{{ ip.addr }}{% endif %}