code logical error exists in vmwareapi vif.py

Bug #1177635 reported by Yaguang Tang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Yaguang Tang
Grizzly
Fix Released
High
Yaguang Tang

Bug Description

nova/virt/vmwareapi/vif.py

60 if network_ref is None:
 61 # Create a port group on the vSwitch associated with the
 62 # vlan_interface corresponding physical network adapter on the ESX
 63 # host.
 64 network_util.create_port_group(session, bridge,
 65 vswitch_associated, vlan_num,
 66 cluster)
 67 else:
 68 # Get the vlan id and vswitch corresponding to the port group
 69 _get_pg_info = network_util.get_vlanid_and_vswitch_for_portgroup
 70 pg_vlanid, pg_vswitch = _get_pg_info(session, bridge, cluster)
 71
 72 # Check if the vswitch associated is proper
 73 if pg_vswitch != vswitch_associated:
 74 raise exception.InvalidVLANPortGroup(
 75 bridge=bridge, expected=vswitch_associated,
 76 actual=pg_vswitch)
 77

the check for pg_vlanid, pg_vswitch logic code have wrong indent , cause a referenced before assignment error.

Tags: vmware
Changed in nova:
assignee: nobody → Yaguang Tang (heut2008)
status: New → In Progress
Yaguang Tang (heut2008)
tags: added: vmware
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/28277
Committed: http://github.com/openstack/nova/commit/b7f9940769618616d37267a50afe495bb8608d27
Submitter: Jenkins
Branch: master

commit b7f9940769618616d37267a50afe495bb8608d27
Author: Yaguang Tang <email address hidden>
Date: Mon May 6 15:54:54 2013 +0800

    Add unitests for VMware vif, and fix code logical error.

    Fix code logical error that cause variable referenced before assignment.
    Add unittests for vmwareapi vif.

    Fix bug #1177635

    Change-Id: I6656e8b77417061eca2a56d50820f5385c0ae987

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
importance: Undecided → High
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/grizzly)

Reviewed: https://review.openstack.org/27885
Committed: http://github.com/openstack/nova/commit/3546cdeb0548e03e71004914b2ab651a316fe047
Submitter: Jenkins
Branch: stable/grizzly

commit 3546cdeb0548e03e71004914b2ab651a316fe047
Author: Yaguang Tang <email address hidden>
Date: Tue Apr 23 18:55:19 2013 +0800

    Support FlatDHCP network for VMware Hyper.

    Auto create bridge when using FlatDHCP network, Add unittests for vif.

    Fix bug #1171783
    Fix bug #1177635

    Change-Id: Ibb75c8e3174283f0f5e94bacfd61ee93e8bd6227
    (cherry picked from commit bc66b8aa968a0c0b74e2f21ed0fc856f8933c6d3)

tags: added: in-stable-grizzly
Alan Pevec (apevec)
tags: removed: in-stable-grizzly
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 2013.2
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.