From 4db34f616d2bd25be830a28adb4b462630208c3d Mon Sep 17 00:00:00 2001 From: Marek Lycka Date: Fri, 29 Sep 2017 11:16:13 +0200 Subject: [PATCH] Added type checks for ha device owners Added owner check types to is_interface function calls used by templates to decide if the 'delete interface' button should be displayed or not. Change-Id: I47000d425d2a3b81c776f791cbfeb82fd7f3e0f9 Closes-Bug: 1720327 --- .../static/js/horizon.flatnetworktopology.js | 7 ++++++- openstack_dashboard/static/js/horizon.networktopology.js | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/static/js/horizon.flatnetworktopology.js b/openstack_dashboard/static/js/horizon.flatnetworktopology.js index b73146bb27..1dee1d3f20 100644 --- a/openstack_dashboard/static/js/horizon.flatnetworktopology.js +++ b/openstack_dashboard/static/js/horizon.flatnetworktopology.js @@ -545,7 +545,12 @@ horizon.flat_network_topology = { object.network_id = network_id; object.ip_address = ip_address; object.device_owner = device_owner; - object.is_interface = (device_owner === 'router_interface' || device_owner === 'router_gateway'); + object.is_interface = ( + device_owner === 'router_interface' || + device_owner === 'router_gateway' || + device_owner === 'ha_router_replicated_interface' + ); + // (device_owner === 'router_interface' || device_owner === 'router_gateway'); ports.push(object); }); var html; diff --git a/openstack_dashboard/static/js/horizon.networktopology.js b/openstack_dashboard/static/js/horizon.networktopology.js index 5083e1b55b..18cf337e95 100644 --- a/openstack_dashboard/static/js/horizon.networktopology.js +++ b/openstack_dashboard/static/js/horizon.networktopology.js @@ -957,7 +957,11 @@ horizon.network_topology = { object.ip_address = ipAddress; object.device_owner = deviceOwner; object.network_id = networkId; - object.is_interface = (deviceOwner === 'router_interface' || deviceOwner === 'router_gateway'); + object.is_interface = ( + deviceOwner === 'router_interface' || + deviceOwner === 'router_gateway' || + deviceOwner === 'ha_router_replicated_interface' + ); ports.push(object); }); } else if (d.hasOwnProperty('subnets')) {