NameError: name 'port' is not defined

Bug #1264829 reported by Du Yujie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Du Yujie

Bug Description

Create Instance:

        if api.neutron.is_port_profiles_supported():
            net_id = context['network_id'][0]
            LOG.debug("Horizon->Create Port with %(netid)s %(profile_id)s",
                      {'netid': net_id, 'profile_id': context['profile_id']})
            try:
                port = api.neutron.port_create(request, net_id,
                                               policy_profile_id=
                                               context['profile_id'])
            except Exception:
                msg = (_('Port not created for profile-id (%s).') %
                       context['profile_id'])
                exceptions.handle(request, msg)
            if port and port.id:
                nics = [{"port-id": port.id}]

if error raised during api.neutron.port_create calling, NameError would met at "if port and port.id"

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

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

Changed in horizon:
assignee: nobody → Du Yujie (du-yujie-os)
status: New → In Progress
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Medium
milestone: none → icehouse-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/64358
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6ec79f444dc15ee81850d1c78bd1eeca6c150527
Submitter: Jenkins
Branch: master

commit 6ec79f444dc15ee81850d1c78bd1eeca6c150527
Author: Du Yujie <du.yujie.os@99cloud.net>
Date: Sun Dec 29 05:36:29 2013 -0800

    Add init value None to port

    In file openstack_dashboard/dashboards/project/instances/workflows/
    create_instance.py, function handle(), add init value None to port
    to avoid NameError.

    Change-Id: I592207cc04efd7838c7b055d430393775ddfa313
    Closes-Bug: #1264829

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-2 → 2014.1
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.