cliff 1.16-17.0 breaks neutron lbaas-loadbalancer-list when no load balancers are present

Bug #1547707 reported by Michael Johnson
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
cliff
New
Undecided
Unassigned

Bug Description

Using cliff 1.16.0 or 1.17.0 we get an exception when listing load balancers and there are no load balancers in the tenant.

stack@devstack:~$ neutron lbaas-loadbalancer-list

<keystone debug removed>

DEBUG: keystoneauth.session REQ: curl -g -i -X GET http://172.21.21.14:9696/v2.0/lbaas/loadbalancers.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}<redacted>"
DEBUG: keystoneauth.session RESP: [200] Date: Fri, 19 Feb 2016 23:06:08 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 21 X-Openstack-Request-Id: req-125303b1-f191-4bfe-8ffa-32a69afd6d95
RESP BODY: {"loadbalancers": []}

ERROR: neutronclient.shell list index out of range
Traceback (most recent call last):
  File "/opt/stack/python-neutronclient/neutronclient/shell.py", line 823, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/opt/stack/python-neutronclient/neutronclient/shell.py", line 105, in run_command
    return cmd.run(known_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

Previous behavior with cliff 1.15.0 installed we get blank lines.

stack@devstack:~$ neutron lbaas-loadbalancer-list

summary: - cliff 1.17.0 breaks neutron lbaas-loadbalancer-list when no load
+ cliff 1.16-17.0 breaks neutron lbaas-loadbalancer-list when no load
balancers are present
description: updated
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.