connection limit can update successfully without value

Bug #1548684 reported by Paco Peng
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Expired
Medium
Unassigned

Bug Description

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 |
+---------------------------+------------------------------------------------+

Changed in octavia:
importance: Undecided → Medium
Revision history for this message
li,chen (chen-li) wrote :

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 ====
......
    def run(): <=== here ====
......
        _extra_values = parse_args_to_dict(self.values_specs) <=== here ====
        _merge_args(self, parsed_args, _extra_values,
                    self.values_specs)
......
        if self.resource in body:
            body[self.resource].update(_extra_values) <=== give the value(True/1) to body ===

def parse_args_to_dict(values_specs):
......
    # Deal with last one argument
    _process_previous_argument(
        current_arg, _value_number, current_type_str,
        _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):
    if current_arg is not None:
        if _value_number == 0 and (current_type_str or _list_flag):
                # This kind of argument should have value
                raise exceptions.CommandError(
                    _("Invalid values_specs %s") % ' '.join(values_specs))
        if _value_number > 1 or _list_flag or current_type_str == 'list':
            current_arg.update({'nargs': '+'})
        elif _value_number == 0:
            if _clear_flag:
                # if we have action=clear, we use argument's default
                # value None for argument
                _values_specs.pop()
            else:
                # We assume non value argument as bool one
                current_arg.update({'action': 'store_true'}) <======= here ======

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.

Changed in python-neutronclient:
status: New → Confirmed
importance: Undecided → Medium
no longer affects: octavia
Changed in python-neutronclient:
assignee: nobody → Anindita Das (anindita-das)
Changed in python-neutronclient:
status: Confirmed → In Progress
Revision history for this message
Anindita Das (anindita-das) wrote :

I am unable to lbaas in devstack successfully. This bug depends on https://bugs.launchpad.net/octavia/+bug/1506027

Revision history for this message
Anindita Das (anindita-das) wrote :

Typo: I am unable to install lbaas in devstack successfully

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 180 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in python-neutronclient:
assignee: Anindita Das (anindita-das) → nobody
status: In Progress → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-neutronclient because there has been no activity for 60 days.]

Changed in python-neutronclient:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.