summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiro Motoki <amotoki@gmail.com>2019-03-21 16:41:37 +0900
committerIvan Kolodyazhny <e0ne@e0ne.info>2019-03-21 19:46:52 +0000
commit273de58cccfd7c82dbe7372b7c8a7d9d9dd39b06 (patch)
tree1b401a94c06d362ba271cd6ecbb0926d2cbd105f
parent18efb06cddf838e3d49f71697480b311045ff5a3 (diff)
downloadhorizon-273de58cccfd7c82dbe7372b7c8a7d9d9dd39b06.tar.gz
network topology: handle port AZ correctly
Previously d3 version of the network topology view handles ports with device_owner 'compute:nova' and 'compute:None' specially. This leads to the situtaion that neutron ports with non-default AZ are not shown properly. There is no reason to handle neutron ports with the default AZ differently. What we would like to do is just to classify neutron ports attached to nova servers. This commit changes the logic to check device_owner of ports have a prefix 'compute:'. Note that we also need to check if device_owner is a string before checking the prefix. Change-Id: I472bae9af3d14d8a31efcae8a7610b84c4f09c3d Closes-Bug: #1820260 (cherry picked from commit ffbe0e2f2f96556f4476ea3873af1bc628c879ca)
-rw-r--r--openstack_dashboard/static/js/horizon.networktopology.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/openstack_dashboard/static/js/horizon.networktopology.js b/openstack_dashboard/static/js/horizon.networktopology.js
index 97df127d3..c94da2953 100644
--- a/openstack_dashboard/static/js/horizon.networktopology.js
+++ b/openstack_dashboard/static/js/horizon.networktopology.js
@@ -743,7 +743,7 @@ horizon.network_topology = {
var device = self.find_by_id(port.device_id);
var _network = self.find_by_id(port.network_id);
if (angular.isDefined(device) && angular.isDefined(_network)) {
- if (port.device_owner == 'compute:nova' || port.device_owner == 'compute:None') {
+ if (port.device_owner && port.device_owner.startsWith('compute:')) {
_network.data.instances++;
device.data.networks.push(_network.data);
if (port.fixed_ips) {
@@ -773,7 +773,8 @@ horizon.network_topology = {
}
self.new_link(self.find_by_id(port.device_id), self.find_by_id(port.network_id));
change = true;
- } else if (angular.isDefined(_network) && port.device_owner == 'compute:nova') {
+ } else if (angular.isDefined(_network) &&
+ port.device_owner && port.device_owner.startsWith('compute:')) {
// Need to add a previously hidden node to the graph because it is
// connected to more than 1 network
if (_network.data.collapsed) {