← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1558434] [NEW] neutron net-list throws error when there is no network created in the data base

 

You have been subscribed to a public bug:

When there is no  network created in the data base, neutron net-list
sould not throw any error.

stack@cs-ccp-c0-m1-management:~/cmc/HPN$ neutron net-list --debug
DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET http://101.10.20.8:5000/v3 -H "Accept: application/json" -H "User-Agent: neutron"
DEBUG: keystoneclient.session RESP: [200] Content-Length: 250 Vary: X-Auth-Token Server: Apache/2.4.10 (Debian) Date: Thu, 17 Mar 2016 08:23:52 GMT Content-Type: application/json x-openstack-request-id: req-b10b9143-b346-4db2-ba0f-010e7b3c688d
RESP BODY: {"version": {"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "http://101.10.20.8:5000/v3/";, "rel": "self"}]}}

DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('json = cliff.formatters.json_format:JSONFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('csv = cliff.formatters.commaseparated:CSVLister')
DEBUG: stevedore.extension found extension EntryPoint.parse('value = cliff.formatters.value:ValueFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('yaml = cliff.formatters.yaml_format:YAMLFormatter')
DEBUG: neutronclient.neutron.v2_0.network.ListNetwork get_data(Namespace(columns=[], fields=[], formatter='table', max_width=0, noindent=False, page_size=None, quote_mode='nonnumeric', request_format='json', show_details=False, sort_dir=[], sort_key=[]))
DEBUG: keystoneclient.auth.identity.v3.base Making authentication request to http://101.10.20.8:5000/v3/auth/tokens
DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway_connection = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway_connection')
DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway')
DEBUG: stevedore.extension found extension EntryPoint.parse('ovsvapp_mitigated_cluster = networking_vsphere.neutronclient._ovsvapp_mitigated_cluster')
DEBUG: stevedore.extension found extension EntryPoint.parse('ovsvapp_cluster = networking_vsphere.neutronclient._ovsvapp_cluster')
DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET http://101.10.20.8:9696/v2.0/networks.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}e564e605ec2b962001cf99f1b4e1fd4c5a2765c7"
DEBUG: keystoneclient.session RESP: [200] Date: Thu, 17 Mar 2016 08:23:53 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 16 X-Openstack-Request-Id: req-2efd487d-ba6f-4241-9ddc-645245dfd7e0
RESP BODY: {"networks": []}

DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET http://101.10.20.8:9696/v2.0/subnets.json?fields=id&fields=cidr -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}e564e605ec2b962001cf99f1b4e1fd4c5a2765c7"
DEBUG: keystoneclient.session RESP: [200] Date: Thu, 17 Mar 2016 08:23:53 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 15 X-Openstack-Request-Id: req-628001ca-b252-4543-8c0a-32bce929130c
RESP BODY: {"subnets": []}

ERROR: neutronclient.shell list index out of range
Traceback (most recent call last):
  File "/opt/stack/venv/neutronclient-20160301T130557Z/lib/python2.7/site-packages/neutronclient/shell.py", line 814, in run_subcommand
    return run_command(cmd, cmd_parser, sub_argv)
  File "/opt/stack/venv/neutronclient-20160301T130557Z/lib/python2.7/site-packages/neutronclient/shell.py", line 110, in run_command
    return cmd.run(known_args)
  File "/opt/stack/venv/neutronclient-20160301T130557Z/lib/python2.7/site-packages/neutronclient/common/command.py", line 29, in run
    return super(OpenStackCommand, self).run(parsed_args)
  File "/opt/stack/venv/neutronclient-20160301T130557Z/lib/python2.7/site-packages/cliff/display.py", line 88, in run
    self.produce_output(parsed_args, column_names, data)
  File "/opt/stack/venv/neutronclient-20160301T130557Z/lib/python2.7/site-packages/cliff/lister.py", line 51, in produce_output
    parsed_args,
  File "/opt/stack/venv/neutronclient-20160301T130557Z/lib/python2.7/site-packages/cliff/formatters/table.py", line 64, in emit_list
    stdout, x, int(parsed_args.max_width), min_width)
  File "/opt/stack/venv/neutronclient-20160301T130557Z/lib/python2.7/site-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
stack@cs-ccp-c0-m1-management:~/cmc/HPN$ nc one
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | ad432337-7269-4d03-ae2c-c14ca1a88f92 |
| mtu                       | 0                                    |
| name                      | one                                  |
| provider:network_type     | vlan                                 |
| provider:physical_network | vlan                                 |
| provider:segmentation_id  | 1079                                 |
| router:external           | False                                |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tenant_id                 | 57d136ce2fe34162a8bc3b2fabb4d0a5     |
+---------------------------+--------------------------------------+
stack@cs-ccp-c0-m1-management:~/cmc/HPN$ neutron net-list --debug
DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET http://101.10.20.8:5000/v3 -H "Accept: application/json" -H "User-Agent: neutron"
DEBUG: keystoneclient.session RESP: [200] Content-Length: 250 Vary: X-Auth-Token Server: Apache/2.4.10 (Debian) Date: Thu, 17 Mar 2016 08:24:14 GMT Content-Type: application/json x-openstack-request-id: req-e2936b34-87fb-4b63-8af6-69961acf2b09
RESP BODY: {"version": {"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "http://101.10.20.8:5000/v3/";, "rel": "self"}]}}

DEBUG: stevedore.extension found extension EntryPoint.parse('table = cliff.formatters.table:TableFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('json = cliff.formatters.json_format:JSONFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('csv = cliff.formatters.commaseparated:CSVLister')
DEBUG: stevedore.extension found extension EntryPoint.parse('value = cliff.formatters.value:ValueFormatter')
DEBUG: stevedore.extension found extension EntryPoint.parse('yaml = cliff.formatters.yaml_format:YAMLFormatter')
DEBUG: neutronclient.neutron.v2_0.network.ListNetwork get_data(Namespace(columns=[], fields=[], formatter='table', max_width=0, noindent=False, page_size=None, quote_mode='nonnumeric', request_format='json', show_details=False, sort_dir=[], sort_key=[]))
DEBUG: keystoneclient.auth.identity.v3.base Making authentication request to http://101.10.20.8:5000/v3/auth/tokens
DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway_connection = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway_connection')
DEBUG: stevedore.extension found extension EntryPoint.parse('l2_gateway = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway')
DEBUG: stevedore.extension found extension EntryPoint.parse('ovsvapp_mitigated_cluster = networking_vsphere.neutronclient._ovsvapp_mitigated_cluster')
DEBUG: stevedore.extension found extension EntryPoint.parse('ovsvapp_cluster = networking_vsphere.neutronclient._ovsvapp_cluster')
DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET http://101.10.20.8:9696/v2.0/networks.json -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}9c61b1b0edc353551374fcaefb46f128edd5e2b0"
DEBUG: keystoneclient.session RESP: [200] Date: Thu, 17 Mar 2016 08:24:14 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 342 X-Openstack-Request-Id: req-307fa5a6-0441-422c-87d6-84a204b5a658
RESP BODY: {"networks": [{"status": "ACTIVE", "subnets": [], "name": "one", "provider:physical_network": "vlan", "admin_state_up": true, "tenant_id": "57d136ce2fe34162a8bc3b2fabb4d0a5", "mtu": 0, "router:external": false, "shared": false, "provider:network_type": "vlan", "id": "ad432337-7269-4d03-ae2c-c14ca1a88f92", "provider:segmentation_id": 1079}]}

DEBUG: keystoneclient.session REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET http://101.10.20.8:9696/v2.0/subnets.json?fields=id&fields=cidr -H "User-Agent: python-neutronclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}9c61b1b0edc353551374fcaefb46f128edd5e2b0"
DEBUG: keystoneclient.session RESP: [200] Date: Thu, 17 Mar 2016 08:24:14 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 15 X-Openstack-Request-Id: req-c194f89c-799e-4786-8830-96f3355be1f8
RESP BODY: {"subnets": []}

+--------------------------------------+------+---------+
| id                                   | name | subnets |
+--------------------------------------+------+---------+
| ad432337-7269-4d03-ae2c-c14ca1a88f92 | one  |         |
+--------------------------------------+------+---------+
stack@cs-ccp-c0-m1-management:~/cmc/HPN$

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
neutron net-list throws error when there is no network created in the data base
https://bugs.launchpad.net/bugs/1558434
You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron.