Throw meaningful exception on POST to ports with misconfigured network

Bug #1611440 reported by Kyle Haley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
quark
Fix Released
Undecided
Kyle Haley

Bug Description

This will throw a 500 KeyError if a user attempts to create a port on a network that is not configured using the unmanaged driver. We need to throw a meaningful exception.

    def create_port(self, context, network_id, port_id, **kwargs):
        LOG.info("create_port %s %s %s" % (context.tenant_id, network_id,
                                           port_id))
        bridge_name = STRATEGY.get_network(network_id)["bridge"]
        return {"uuid": port_id, "bridge": bridge_name}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quark (master)

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

Changed in neutron-quark:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quark (master)

Reviewed: https://review.openstack.org/352998
Committed: https://git.openstack.org/cgit/openstack/quark/commit/?id=c6f52079673fd2eeffde40ae778577cb9005edcb
Submitter: Jenkins
Branch: master

commit c6f52079673fd2eeffde40ae778577cb9005edcb
Author: Kyle Haley <email address hidden>
Date: Tue Aug 9 08:33:33 2016 -0700

    Throw meaningful exception bad network config

    In the unmanaged driver, create port will fail with a KeyError
    if a network_id is used that isn't configured properly in
    neutron.conf (ie - bridge isn't defined). Added checks and
    meaningful error for users.

    Change-Id: Ief9c2371100063ff679858abc5fdf7cc24ec9dda
    Closes-Bug: #1611440
    JIRA:NCP-2012

Changed in neutron-quark:
status: In Progress → Fix Released
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.