List command is returning "List out of index" for Multi-Node devstack

Bug #1553636 reported by Reedip
This bug report is a duplicate of:  Bug #1539770: Empty set causing out of range error. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
New
Undecided
Unassigned

Bug Description

 Summary (Bug title): List index out of range returned for NeutronClient CLIs when there is no resource created, on a multi-node devstack

Additional Information given below:
Message: 3
Date: Fri, 4 Mar 2016 23:23:29 +0000
From: Anil Rao <email address hidden>
To: "OpenStack Development Mailing List (not for usage questions)"
        <email address hidden>
Subject: [openstack-dev] [neutron][taas] tap-service-list /
        tap-flow-list failure when list is empty
Message-ID:
        <email address hidden>

Content-Type: text/plain; charset="us-ascii"

Hi,

Here is some additional information pertaining to the failures I am seeing when invoking the tap-service-list and tap-flow-list commands. This is on a multi-node DevStack environment (1 controller node, I network node and 2 compute nodes).

1. The tap-service-list command returns a failure when there are no tap-services.

2. The tap-flow-list command returns a failure when there are no tap-flows.

3. Both commands work as expected when the respective objects are present.

See example output (for tap-services) below.

osadmin@ds-ctl:~$ neutron tap-service-list
list index out of range
osadmin@ds-ctl:~$ neutron tap-service-create --name TS1 --description "tap-service-1" --port 2100906e-cb1a-4ab4-b50f-77f55a3f0793 --network cfb88d7c-8e9e-4954-a923-2f9cac3b4ebe
Created a new tap_service:
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| description | tap-service-1 |
| id | 1086170e-a9cd-41bd-a5df-7ad4782da337 |
| name | TS1 |
| port_id | 2100906e-cb1a-4ab4-b50f-77f55a3f0793 |
| tenant_id | 93c1c68f06e843938159329bfdbed384 |
+-------------+--------------------------------------+
osadmin@ds-ctl:~$ neutron tap-service-list
+--------------------------------------+------+
| id | name |
+--------------------------------------+------+
| 1086170e-a9cd-41bd-a5df-7ad4782da337 | TS1 |
+--------------------------------------+------+
osadmin@ds-ctl:~$ neutron tap-service-delete TS1
Deleted tap_service: TS1
osadmin@ds-ctl:~$ neutron tap-service-list
list index out of range

Here is the output of tap-service-list with the "-debug" flag. The error is being reported by neutronclient.shell.

DEBUG: keystoneauth.session RESP: [200] Date: Fri, 04 Mar 2016 22:50:16 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 20 X-Openstack-Request-Id: req-641ba1a0-7f49-4460-b720-313d92009b87
RESP BODY: {"tap_services": []}

ERROR: neutronclient.shell list index out of range
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 819, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/shell.py", line 105, in run_command
    return cmd.run(known_args)
  File "/usr/local/lib/python2.7/dist-packages/neutronclient/common/command.py", line 29, in run
    return super(OpenStackCommand, self).run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/cliff/display.py", line 88, in run
    self.produce_output(parsed_args, column_names, data)
  File "/usr/local/lib/python2.7/dist-packages/cliff/lister.py", line 51, in produce_output
    parsed_args,
  File "/usr/local/lib/python2.7/dist-packages/cliff/formatters/table.py", line 64, in emit_list
    stdout, x, int(parsed_args.max_width), min_width)
  File "/usr/local/lib/python2.7/dist-packages/cliff/formatters/table.py", line 148, in _assign_max_widths
    first_line = x.get_string().splitlines()[0]
IndexError: list index out of range
list index out of range

It appears that other list commands associated with the neutron client also show the same type of failure when their lists are empty.

osadmin@ds-ctl:~$ neutron agent-list
list index out of range
osadmin@ds-ctl:~$ neutron address-scope-list
list index out of range

Thanks,
Anil

Changed in python-neutronclient:
assignee: nobody → Reedip (reedip-banerjee)
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.