when the end user does not provider the value for connection_limit , it should inform the end user to add it , not set it with the value 1.
stack@paco-kilo02:~$ neutron lbaas-listener-show ebdf0a12-bd4b-4d3a-92f1-446680657885
+---------------------------+------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------+
| admin_state_up | True |
| connection_limit | 100 |
| default_pool_id | |
| default_tls_container_ref | |
| description | |
| id | ebdf0a12-bd4b-4d3a-92f1-446680657885 |
| loadbalancers | {"id": "b83ba290-cab0-4664-8ae3-32d2e58dde26"} |
| name | listenerHTTP |
| protocol | HTTP |
| protocol_port | 80 |
| sni_container_refs | |
| tenant_id | 1a050f840fff43d0af1036d83f0c11ff |
+---------------------------+------------------------------------------------+
stack@paco-kilo02:~$ neutron lbaas-listener-update ebdf0a12-bd4b-4d3a-92f1-446680657885 --connection_limit
Updated listener: ebdf0a12-bd4b-4d3a-92f1-446680657885
stack@paco-kilo02:~$ neutron lbaas-listener-show ebdf0a12-bd4b-4d3a-92f1-446680657885
+---------------------------+------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------+
| admin_state_up | True |
| connection_limit | 1 |
| default_pool_id | |
| default_tls_container_ref | |
| description | |
| id | ebdf0a12-bd4b-4d3a-92f1-446680657885 |
| loadbalancers | {"id": "b83ba290-cab0-4664-8ae3-32d2e58dde26"} |
| name | listenerHTTP |
| protocol | HTTP |
| protocol_port | 80 |
| sni_container_refs | |
| tenant_id | 1a050f840fff43d0af1036d83f0c11ff |
+---------------------------+------------------------------------------------+
stack@paco-kilo02:~$ neutron lbaas-listener-update ebdf0a12-bd4b-4d3a-92f1-446680657885 --connection_limit 100
Updated listener: ebdf0a12-bd4b-4d3a-92f1-446680657885
stack@paco-kilo02:~$ neutron lbaas-listener-show ebdf0a12-bd4b-4d3a-92f1-446680657885
+---------------------------+------------------------------------------------+
| Field | Value |
+---------------------------+------------------------------------------------+
| admin_state_up | True |
| connection_limit | 100 |
| default_pool_id | |
| default_tls_container_ref | |
| description | |
| id | ebdf0a12-bd4b-4d3a-92f1-446680657885 |
| loadbalancers | {"id": "b83ba290-cab0-4664-8ae3-32d2e58dde26"} |
| name | listenerHTTP |
| protocol | HTTP |
| protocol_port | 80 |
| sni_container_refs | |
| tenant_id | 1a050f840fff43d0af1036d83f0c11ff |
+---------------------------+------------------------------------------------+
I did a little check on this.
I think the reason we get "connection_ limit=1" when we not provider the value for connection_limit might be caused by:
neutronclient/ neutron/ v2_0/__ init__. py:
class UpdateCommand(): <=== here ====
_extra_ values = parse_args_ to_dict( self.values_ specs) <=== here ====
_merge_ args(self, parsed_args, _extra_values,
self. values_ specs)
body[ self.resource] .update( _extra_ values) <=== give the value(True/1) to body ===
......
def run(): <=== here ====
......
......
if self.resource in body:
def parse_args_ to_dict( values_ specs): previous_ argument(
current_ arg, _value_number, current_type_str,
......
# Deal with last one argument
_process_
_list_flag, _values_specs, _clear_flag, values_specs) <===== here ======
def _process_ previous_ argument( current_ arg, _value_number, current_type_str,
_list_ flag, _values_specs, _clear_flag,
values_ specs):
raise exceptions. CommandError(
_ ("Invalid values_specs %s") % ' '.join( values_ specs))
current_ arg.update( {'nargs' : '+'})
_values_ specs.pop( )
current_ arg.update( {'action' : 'store_true'}) <======= here ======
if current_arg is not None:
if _value_number == 0 and (current_type_str or _list_flag):
# This kind of argument should have value
if _value_number > 1 or _list_flag or current_type_str == 'list':
elif _value_number == 0:
if _clear_flag:
# if we have action=clear, we use argument's default
# value None for argument
else:
# We assume non value argument as bool one
I believe this is actually a neutron-client issue.
The difficult on solving the issue is, we can not just ignore the value "True/False", because in python True==1, False==0.