UnboundLocalError for target_iqn gets thrown if login fails

Bug #1211774 reported by Brad Pokorny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Brad Pokorny

Bug Description

If the login to the storage target fails at this line when using Hyper-V:

https://github.com/openstack/nova/blob/master/nova/virt/hyperv/volumeops.py#L112

An UnboundLocalError gets thrown during error handling, as target_iqn hasn't yet been defined.

2013-08-07 14:16:50.267 1760 TRACE nova.compute.manager [instance: 4af61430-2767-487c-b0db-11890fb526a3]
2013-08-07 14:16:50.720 1760 ERROR nova.openstack.common.rpc.amqp [req-2730cf74-1a1d-4606-893f-8b1354314b10 911c0704817d4eb7b79d2e5e42061d67 44804665fbab4368bb306d97de7e6171] Exception during message handling
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\openstack\common\rpc\amqp.py", line 421, in _process_data
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp **args)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\openstack\common\rpc\dispatcher.py", line 172, in dispatch
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\exception.py", line 100, in wrapped
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp temp_level, payload)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\exception.py", line 77, in wrapped
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp return f(self, context, *args, **kw)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 235, in decorated_function
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp pass
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 221, in decorated_function
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 263, in decorated_function
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp e, sys.exc_info())
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 250, in decorated_function
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 3468, in attach_volume
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp context, instance, mountpoint)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 3463, in attach_volume
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp mountpoint, instance)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 3505, in _attach_volume
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp connector)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\compute\manager.py", line 3495, in _attach_volume
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp mountpoint)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\driver.py", line 71, in attach_volume
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp instance['name'])
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp File "C:\Program Files (x86)\IBM\SmartCloud Entry\Hyper-V Agent\Python27\lib\site-packages\nova\virt\hyperv\volumeops.py", line 152, in attach_volume
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp self._volutils.logout_storage_target(target_iqn)
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp UnboundLocalError: local variable 'target_iqn' referenced before assignment
2013-08-07 14:16:50.720 1760 TRACE nova.openstack.common.rpc.amqp

Brad Pokorny (bpokorny)
Changed in nova:
assignee: nobody → Brad Pokorny (bpokorny)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
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.