diff --git a/neutron_lbaas/drivers/haproxy/jinja_cfg.py b/neutron_lbaas/drivers/haproxy/jinja_cfg.py index 1ef5209f0..22dadf310 100644 --- a/neutron_lbaas/drivers/haproxy/jinja_cfg.py +++ b/neutron_lbaas/drivers/haproxy/jinja_cfg.py @@ -255,7 +255,7 @@ def _transform_loadbalancer(loadbalancer, haproxy_base_dir): pools = [_transform_pool(x) for x in loadbalancer.pools] connection_limit = _compute_global_connection_limit(listeners) return { - 'name': loadbalancer.name, + 'id': loadbalancer.id, 'vip_address': loadbalancer.vip_address, 'connection_limit': connection_limit, 'listeners': listeners, diff --git a/neutron_lbaas/drivers/haproxy/templates/haproxy.loadbalancer.j2 b/neutron_lbaas/drivers/haproxy/templates/haproxy.loadbalancer.j2 index 2cedb326e..8bc8a57f8 100644 --- a/neutron_lbaas/drivers/haproxy/templates/haproxy.loadbalancer.j2 +++ b/neutron_lbaas/drivers/haproxy/templates/haproxy.loadbalancer.j2 @@ -14,7 +14,7 @@ # #} {% extends 'haproxy_proxies.j2' %} -{% set loadbalancer_name = loadbalancer.name %} +{% set loadbalancer_id = loadbalancer.id %} {% set usergroup = user_group %} {% set sock_path = stats_sock %} {% set connection_limit = loadbalancer.connection_limit %} diff --git a/neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2 b/neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2 index d9e48b636..b60adcd38 100644 --- a/neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2 +++ b/neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2 @@ -13,7 +13,7 @@ # under the License. # #} -# Configuration for {{ loadbalancer_name }} +# Configuration for {{ loadbalancer_id }} global daemon user nobody diff --git a/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py b/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py index d4a015e1f..2025c67a9 100644 --- a/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py +++ b/neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py @@ -101,21 +101,21 @@ RET_LISTENER_TLS_SNI = { 'sni_containers': [RET_SNI_CONT_1, RET_SNI_CONT_2]} RET_LB = { - 'name': 'test-lb', + 'id': 'sample_loadbalancer_id_1', 'vip_address': '10.0.0.2', 'listeners': [RET_LISTENER], 'connection_limit': RET_LISTENER['connection_limit'], 'pools': [RET_POOL]} RET_LB_TLS = { - 'name': 'test-lb', + 'id': 'sample_loadbalancer_id_1', 'vip_address': '10.0.0.2', 'listeners': [RET_LISTENER_TLS], 'connection_limit': RET_LISTENER_TLS['connection_limit'], 'pools': [RET_POOL]} RET_LB_TLS_SNI = { - 'name': 'test-lb', + 'id': 'sample_loadbalancer_id_1', 'vip_address': '10.0.0.2', 'listeners': [RET_LISTENER_TLS_SNI], 'connection_limit': RET_LISTENER_TLS_SNI['connection_limit'], @@ -126,11 +126,10 @@ def sample_loadbalancer_tuple(proto=None, monitor=True, persistence=True, persistence_type=None, tls=False, sni=False): proto = 'HTTP' if proto is None else proto in_lb = collections.namedtuple( - 'loadbalancer', 'id, name, vip_address, protocol, vip_port, ' + 'loadbalancer', 'id, vip_address, protocol, vip_port, ' 'listeners, pools') return in_lb( id='sample_loadbalancer_id_1', - name='test-lb', vip_address='10.0.0.2', protocol=proto, vip_port=sample_vip_port_tuple(), @@ -311,7 +310,7 @@ def sample_base_expected_config(backend, frontend=None, constants.PROTOCOL_TERMINATED_HTTPS: https_tls_frontend } frontend = fe_mapper[fe_proto] - return ("# Configuration for test-lb\n" + return ("# Configuration for sample_loadbalancer_id_1\n" "global\n" " daemon\n" " user nobody\n"