Browse Source

Merge "Allow to create loadbalancer with chinese character" into stable/queens

stable/queens
Zuul 1 month ago
parent
commit
c626bf6efe

+ 1
- 1
neutron_lbaas/drivers/haproxy/jinja_cfg.py View File

@@ -255,7 +255,7 @@ def _transform_loadbalancer(loadbalancer, haproxy_base_dir):
255 255
     pools = [_transform_pool(x) for x in loadbalancer.pools]
256 256
     connection_limit = _compute_global_connection_limit(listeners)
257 257
     return {
258
-        'name': loadbalancer.name,
258
+        'id': loadbalancer.id,
259 259
         'vip_address': loadbalancer.vip_address,
260 260
         'connection_limit': connection_limit,
261 261
         'listeners': listeners,

+ 1
- 1
neutron_lbaas/drivers/haproxy/templates/haproxy.loadbalancer.j2 View File

@@ -14,7 +14,7 @@
14 14
 #
15 15
 #}
16 16
 {% extends 'haproxy_proxies.j2' %}
17
-{% set loadbalancer_name = loadbalancer.name %}
17
+{% set loadbalancer_id = loadbalancer.id %}
18 18
 {% set usergroup = user_group %}
19 19
 {% set sock_path = stats_sock %}
20 20
 {% set connection_limit = loadbalancer.connection_limit %}

+ 1
- 1
neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2 View File

@@ -13,7 +13,7 @@
13 13
 #    under the License.
14 14
 #
15 15
 #}
16
-# Configuration for {{ loadbalancer_name }}
16
+# Configuration for {{ loadbalancer_id }}
17 17
 global
18 18
     daemon
19 19
     user nobody

+ 5
- 6
neutron_lbaas/tests/unit/drivers/haproxy/sample_configs/sample_configs.py View File

@@ -101,21 +101,21 @@ RET_LISTENER_TLS_SNI = {
101 101
     'sni_containers': [RET_SNI_CONT_1, RET_SNI_CONT_2]}
102 102
 
103 103
 RET_LB = {
104
-    'name': 'test-lb',
104
+    'id': 'sample_loadbalancer_id_1',
105 105
     'vip_address': '10.0.0.2',
106 106
     'listeners': [RET_LISTENER],
107 107
     'connection_limit': RET_LISTENER['connection_limit'],
108 108
     'pools': [RET_POOL]}
109 109
 
110 110
 RET_LB_TLS = {
111
-    'name': 'test-lb',
111
+    'id': 'sample_loadbalancer_id_1',
112 112
     'vip_address': '10.0.0.2',
113 113
     'listeners': [RET_LISTENER_TLS],
114 114
     'connection_limit': RET_LISTENER_TLS['connection_limit'],
115 115
     'pools': [RET_POOL]}
116 116
 
117 117
 RET_LB_TLS_SNI = {
118
-    'name': 'test-lb',
118
+    'id': 'sample_loadbalancer_id_1',
119 119
     'vip_address': '10.0.0.2',
120 120
     'listeners': [RET_LISTENER_TLS_SNI],
121 121
     'connection_limit': RET_LISTENER_TLS_SNI['connection_limit'],
@@ -126,11 +126,10 @@ def sample_loadbalancer_tuple(proto=None, monitor=True, persistence=True,
126 126
                               persistence_type=None, tls=False, sni=False):
127 127
     proto = 'HTTP' if proto is None else proto
128 128
     in_lb = collections.namedtuple(
129
-        'loadbalancer', 'id, name, vip_address, protocol, vip_port, '
129
+        'loadbalancer', 'id, vip_address, protocol, vip_port, '
130 130
                         'listeners, pools')
131 131
     return in_lb(
132 132
         id='sample_loadbalancer_id_1',
133
-        name='test-lb',
134 133
         vip_address='10.0.0.2',
135 134
         protocol=proto,
136 135
         vip_port=sample_vip_port_tuple(),
@@ -311,7 +310,7 @@ def sample_base_expected_config(backend, frontend=None,
311 310
             constants.PROTOCOL_TERMINATED_HTTPS: https_tls_frontend
312 311
         }
313 312
         frontend = fe_mapper[fe_proto]
314
-    return ("# Configuration for test-lb\n"
313
+    return ("# Configuration for sample_loadbalancer_id_1\n"
315 314
             "global\n"
316 315
             "    daemon\n"
317 316
             "    user nobody\n"

Loading…
Cancel
Save