UnboundLocalError in TgtAdm.update_iscsi_target in brick

Bug #1270624 reported by Yuriy Taraday
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Yuriy Taraday

Bug Description

If some error occurs on tgt-admin call, update_iscsi_target fails with UnboundLocalError instead of expected ISCSITargetUpdateFailed because of debug output.

Traceback (most recent call last):
  File "/opt/stack/new/cinder/cinder/openstack/common/rpc/amqp.py", line 441, in _process_data
    **args)
  File "/opt/stack/new/cinder/cinder/openstack/common/rpc/dispatcher.py", line 148, in dispatch
    return getattr(proxyobj, method)(ctxt, **kwargs)
  File "/opt/stack/new/cinder/cinder/volume/manager.py", line 345, in create_volume
    _run_flow_locked()
  File "/opt/stack/new/cinder/cinder/openstack/common/lockutils.py", line 233, in inner
    retval = f(*args, **kwargs)
  File "/opt/stack/new/cinder/cinder/volume/manager.py", line 340, in _run_flow_locked
    _run_flow()
  File "/opt/stack/new/cinder/cinder/volume/manager.py", line 336, in _run_flow
    flow_engine.run()
  File "/usr/local/lib/python2.7/dist-packages/taskflow/utils/lock_utils.py", line 51, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 118, in run
    self._run()
  File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 128, in _run
    self._revert(misc.Failure())
  File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 81, in _revert
    misc.Failure.reraise_if_any(failures.values())
  File "/usr/local/lib/python2.7/dist-packages/taskflow/utils/misc.py", line 487, in reraise_if_any
    failures[0].reraise()
  File "/usr/local/lib/python2.7/dist-packages/taskflow/utils/misc.py", line 494, in reraise
    six.reraise(*self._exc_info)
  File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 36, in _execute_task
    result = task.execute(**arguments)
  File "/opt/stack/new/cinder/cinder/volume/flows/create_volume/__init__.py", line 1450, in execute
    model_update = self.driver.create_export(context, volume_ref)
  File "/opt/stack/new/cinder/cinder/volume/drivers/lvm.py", line 595, in create_export
    return self._create_export(context, volume)
  File "/opt/stack/new/cinder/cinder/volume/drivers/lvm.py", line 626, in _create_export
    volume_path, chap_auth)
  File "/opt/stack/new/cinder/cinder/volume/drivers/lvm.py", line 447, in _create_tgtadm_target
    old_name=old_name)
  File "/opt/stack/new/cinder/cinder/brick/iscsi/iscsi.py", line 187, in create_iscsi_target
    self.update_iscsi_target(name)
  File "/opt/stack/new/cinder/cinder/brick/iscsi/iscsi.py", line 253, in update_iscsi_target
    LOG.debug("StdOut from tgt-admin --update: %s" % out)
UnboundLocalError: local variable 'out' referenced before assignment

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

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

Changed in cinder:
assignee: nobody → Yuriy Taraday (yorik-sar)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/67724
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=82283790b7c5ba6ae0e561ee3302d7fed7983267
Submitter: Jenkins
Branch: master

commit 82283790b7c5ba6ae0e561ee3302d7fed7983267
Author: Yuriy Taraday <email address hidden>
Date: Sun Jan 19 23:08:06 2014 +0400

    Fix UnboundLocalError in TgtAdm.update_iscsi_target

    Closes-Bug: #1270624
    Change-Id: I74a057a9603c5d6aefaec6db62228352b739df56

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