diff --git a/vmware_nsx/services/lbaas/nsx_v3/healthmonitor_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/healthmonitor_mgr.py index dae0df39c6..7d17ff884b 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/healthmonitor_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/healthmonitor_mgr.py @@ -66,7 +66,7 @@ class EdgeHealthMonitorManager(base_mgr.Nsxv3LoadbalancerBaseManager): pool_id = hm.pool.id pool_client = self.core_plugin.nsxlib.load_balancer.pool monitor_client = self.core_plugin.nsxlib.load_balancer.monitor - monitor_name = utils.get_name_and_uuid(hm.name, hm.id) + monitor_name = utils.get_name_and_uuid(hm.name or 'monitor', hm.id) tags = lb_utils.get_tags(self.core_plugin, hm.id, lb_const.LB_HM_TYPE, hm.tenant_id, context.project_name) monitor_body = self._build_monitor_args(hm) diff --git a/vmware_nsx/services/lbaas/nsx_v3/lb_utils.py b/vmware_nsx/services/lbaas/nsx_v3/lb_utils.py index 7f6959d36f..fe9a0c2e40 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/lb_utils.py +++ b/vmware_nsx/services/lbaas/nsx_v3/lb_utils.py @@ -31,19 +31,6 @@ def get_tags(plugin, resource_id, resource_type, project_id, project_name): return tags -def get_nsx_resource_binding(client, name, id): - """ - :param client: nsx resource client - :param name: name of neutron object - :param id: id of neutron object - :return: return the nsx resource id - """ - nsx_name = utils.get_name_and_uuid(name, id) - nsx_resource = client.find_by_display_name(nsx_name) - if nsx_resource: - return nsx_resource[0]['id'] - - def get_network_from_subnet(context, plugin, subnet_id): subnet = plugin.get_subnet(context, subnet_id) if subnet: @@ -62,7 +49,7 @@ def get_router_from_network(context, plugin, subnet_id): def get_lb_router_id(context, plugin, lb): router_client = plugin.nsxlib.logical_router - name = utils.get_name_and_uuid(lb.name, lb.id) + name = utils.get_name_and_uuid(lb.name or 'router', lb.id) tags = get_tags(plugin, lb.id, lb_const.LB_LB_TYPE, lb.tenant_id, context.project_name) edge_cluster_uuid = plugin._get_edge_cluster(plugin._default_tier0_router) diff --git a/vmware_nsx/services/lbaas/nsx_v3/listener_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/listener_mgr.py index 578af9dd8b..80baf66780 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/listener_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/listener_mgr.py @@ -83,7 +83,8 @@ class EdgeListenerManager(base_mgr.Nsxv3LoadbalancerBaseManager): app_client = load_balancer.application_profile vs_client = load_balancer.virtual_server service_client = load_balancer.service - vs_name = utils.get_name_and_uuid(listener.name, listener.id) + vs_name = utils.get_name_and_uuid(listener.name or 'listener', + listener.id) tags = lb_utils.get_tags(self.core_plugin, listener.id, lb_const.LB_LISTENER_TYPE, listener.tenant_id, diff --git a/vmware_nsx/services/lbaas/nsx_v3/member_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/member_mgr.py index cda8427b48..f7a435c95a 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/member_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/member_mgr.py @@ -57,7 +57,7 @@ class EdgeMemberManager(base_mgr.Nsxv3LoadbalancerBaseManager): 'external gateway') % {'router': router['id']}) raise n_exc.BadRequest(resource='lbaas-lbservice-create', msg=msg) - lb_name = utils.get_name_and_uuid(router['name'], + lb_name = utils.get_name_and_uuid(router['name'] or 'router', router_id) tags = lb_utils.get_tags(self.core_plugin, router_id, lb_const.LR_ROUTER_TYPE, diff --git a/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py b/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py index 6816d3b30e..5667ef5911 100644 --- a/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py +++ b/vmware_nsx/services/lbaas/nsx_v3/pool_mgr.py @@ -40,7 +40,7 @@ class EdgePoolManager(base_mgr.Nsxv3LoadbalancerBaseManager): lb_id = pool.loadbalancer_id pool_client = self.core_plugin.nsxlib.load_balancer.pool vs_client = self.core_plugin.nsxlib.load_balancer.virtual_server - pool_name = utils.get_name_and_uuid(pool.name, pool.id) + pool_name = utils.get_name_and_uuid(pool.name or 'pool', pool.id) tags = lb_utils.get_tags(self.core_plugin, pool.id, lb_const.LB_POOL_TYPE, pool.tenant_id, context.project_name)