noop network interface cannot list VIFs

Bug #1700497 reported by Mark Goddard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Medium
Mark Goddard

Bug Description

Create a node with the noop network interface, then list the node's VIFs, e.g. via openstack baremetal node vif list <node>. Ironic will return a 500 error code, as can be seen in these logs:

http://logs.openstack.org/49/476949/3/check/gate-tempest-dsvm-ironic-pxe_ipmitool-postgres-ubuntu-xenial-nv/3ec15af/logs/screen-ir-api.txt.gz?#_Jun_26_09_07_27_188855

Jun 26 09:07:27.188855 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: ERROR wsme.api [None req-c49c321f-6a13-4e54-ac3a-78d19f53cc09 admin admin] Server-side error: "'NoneType' object is not iterable". Detail:
Jun 26 09:07:27.188950 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: Traceback (most recent call last):
Jun 26 09:07:27.189038 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: File "/usr/local/lib/python2.7/dist-packages/wsmeext/pecan.py", line 85, in callfunction
Jun 26 09:07:27.189116 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: result = f(self, *args, **kwargs)
Jun 26 09:07:27.189203 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: File "/opt/stack/new/ironic/ironic/api/controllers/v1/node.py", line 1178, in get_all
Jun 26 09:07:27.189281 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: return VifCollection.collection_from_list(vifs)
Jun 26 09:07:27.189357 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: File "/opt/stack/new/ironic/ironic/api/controllers/v1/node.py", line 1152, in collection_from_list
Jun 26 09:07:27.189431 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: col.vifs = [types.VifType.frombasetype(vif) for vif in vifs]
Jun 26 09:07:27.189514 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: TypeError: 'NoneType' object is not iterable
Jun 26 09:07:27.189590 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]:
Jun 26 09:07:27.189672 ubuntu-xenial-osic-cloud1-s3500-9509410 ironic-api[13997]: INFO eventlet.wsgi.server [None req-c49c321f-6a13-4e54-ac3a-78d19f53cc09 admin admin] 10.12.1.94 "GET /v1/nodes/285c01fd-39bc-442d-83a6-dbfc63e1d526/vifs HTTP/1.1" status: 500 len: 465 time: 0.0538151

This is because the noop network interface returns None from vif_list rather than an empty list.

Mark Goddard (mgoddard)
Changed in ironic:
assignee: nobody → Mark Goddard (mgoddard)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/477493

Changed in ironic:
status: New → In Progress
Dmitry Tantsur (divius)
Changed in ironic:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/477493
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=181005106bdf077284a21da71f466266c200b86b
Submitter: Jenkins
Branch: master

commit 181005106bdf077284a21da71f466266c200b86b
Author: Mark Goddard <email address hidden>
Date: Mon Jun 26 11:37:06 2017 +0100

    Fix VIF list for noop network interface

    Creating a node with the noop network interface, then listing the node's
    VIFs, e.g. via openstack baremetal node vif list <node>, ironic
    previously returned a 500 internal server error. This change fixes the
    issue by returning an empty list instead of None from the vif_list
    method.

    This change also adds unit tests to cover the noop network interface as
    it previously had none.

    Change-Id: I327c961f094528d46a78c26610d198ebc2a4f370
    Closes-Bug: #1700497

Changed in ironic:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic 9.0.0

This issue was fixed in the openstack/ironic 9.0.0 release.

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.