yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #08152
[Bug 1268478] [NEW] exception in method _nw_info_build_network of file "nova/network/neutronv2/api.py"
Public bug reported:
In n-cpu.log, got this exception:
2014-01-13 14:11:19.255 ^[[00;32mDEBUG nova.compute.manager [^[[00;36m-^[[00;32m] ^[[01;35m^[[00;32mAn error occurred^[[00m ^[[00;33mfrom (pid=8434) _heal_instance_info_cache /opt/stack/nova/nova/compute/manager.py:4442^[[00m
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00mTraceback (most recent call last):
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/compute/manager.py", line 4438, in _heal_instance_info_cache
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m self._get_instance_nw_info(context, instance, use_slave=True)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/compute/manager.py", line 890, in _get_instance_nw_info
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m instance)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/api.py", line 50, in wrapper
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m res = f(self, context, *args, **kwargs)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 439, in get_instance_nw_info
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m result = self._get_instance_nw_info(context, instance, networks)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 446, in _get_instance_nw_info
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m nw_info = self._build_network_info_model(context, instance, networks)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 1042, in _build_network_info_model
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m subnets)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 977, in _nw_info_build_network
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m label=network_name,
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00mUnboundLocalError: local variable 'network_name' referenced before assignment
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m
Check the code:
def _nw_info_build_network(self, port, networks, subnets):
# NOTE(danms): This loop can't fail to find a network since we
# filtered ports to only the ones matching networks in our parent
for net in networks:
if port['network_id'] == net['id']:
network_name = net['name']
break
bridge = None
ovs_interfaceid = None
# Network model metadata
should_create_bridge = None
vif_type = port.get('binding:vif_type')
# TODO(berrange) Neutron should pass the bridge name
# in another binding metadata field
if vif_type == network_model.VIF_TYPE_OVS:
bridge = CONF.neutron_ovs_bridge
ovs_interfaceid = port['id']
elif vif_type == network_model.VIF_TYPE_BRIDGE:
bridge = "brq" + port['network_id']
should_create_bridge = True
if bridge is not None:
bridge = bridge[:network_model.NIC_NAME_LEN]
network = network_model.Network(
id=port['network_id'],
bridge=bridge,
injected=CONF.flat_injected,
label=network_name,
tenant_id=net['tenant_id']
)
There's a obvious error in the code. Since "network_name" assignment in
the loop can be not hit, we should initialize "network_name" with None.
** Affects: nova
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1268478
Title:
exception in method _nw_info_build_network of file
"nova/network/neutronv2/api.py"
Status in OpenStack Compute (Nova):
New
Bug description:
In n-cpu.log, got this exception:
2014-01-13 14:11:19.255 ^[[00;32mDEBUG nova.compute.manager [^[[00;36m-^[[00;32m] ^[[01;35m^[[00;32mAn error occurred^[[00m ^[[00;33mfrom (pid=8434) _heal_instance_info_cache /opt/stack/nova/nova/compute/manager.py:4442^[[00m
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00mTraceback (most recent call last):
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/compute/manager.py", line 4438, in _heal_instance_info_cache
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m self._get_instance_nw_info(context, instance, use_slave=True)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/compute/manager.py", line 890, in _get_instance_nw_info
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m instance)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/api.py", line 50, in wrapper
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m res = f(self, context, *args, **kwargs)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 439, in get_instance_nw_info
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m result = self._get_instance_nw_info(context, instance, networks)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 446, in _get_instance_nw_info
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m nw_info = self._build_network_info_model(context, instance, networks)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 1042, in _build_network_info_model
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m subnets)
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m File "/opt/stack/nova/nova/network/neutronv2/api.py", line 977, in _nw_info_build_network
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m label=network_name,
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00mUnboundLocalError: local variable 'network_name' referenced before assignment
^[[00;32m2014-01-13 14:11:19.255 TRACE nova.compute.manager ^[[01;35m^[[00m
Check the code:
def _nw_info_build_network(self, port, networks, subnets):
# NOTE(danms): This loop can't fail to find a network since we
# filtered ports to only the ones matching networks in our parent
for net in networks:
if port['network_id'] == net['id']:
network_name = net['name']
break
bridge = None
ovs_interfaceid = None
# Network model metadata
should_create_bridge = None
vif_type = port.get('binding:vif_type')
# TODO(berrange) Neutron should pass the bridge name
# in another binding metadata field
if vif_type == network_model.VIF_TYPE_OVS:
bridge = CONF.neutron_ovs_bridge
ovs_interfaceid = port['id']
elif vif_type == network_model.VIF_TYPE_BRIDGE:
bridge = "brq" + port['network_id']
should_create_bridge = True
if bridge is not None:
bridge = bridge[:network_model.NIC_NAME_LEN]
network = network_model.Network(
id=port['network_id'],
bridge=bridge,
injected=CONF.flat_injected,
label=network_name,
tenant_id=net['tenant_id']
)
There's a obvious error in the code. Since "network_name" assignment
in the loop can be not hit, we should initialize "network_name" with
None.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1268478/+subscriptions
Follow ups
References