ISCSIDriver has no 'target_helper' member

Bug #1400804 reported by Eric Harney
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Critical
John Griffith
Juno
Fix Released
Critical
Unassigned

Bug Description

$ pylint -E cinder/volume/driver.py
************* Module cinder.volume.driver
E:1046,12: Instance of 'ISCSIDriver' has no 'target_helper' member (no-member)
E:1064,12: Instance of 'ISCSIDriver' has no 'target_helper' member (no-member)

1045 if CONF.iscsi_helper == 'lioadm':
1046 self.target_helper.initialize_connection(volume, connector)

https://review.openstack.org/#/c/130399/ put code into driver.py that is specific to the LVM driver.

Revision history for this message
John Griffith (john-griffith) wrote :

Additional info: if you set the iscsi_helper to lioadm in this case, any driver that used to inherit from the base iSCSIDriver class for initialize_connection will fail and stack trace.

The reason is that the iscsi_helper is set in global CONF so if set to lioadm (even if not used) will always eval to true in that method and attempt the target_helper.initialize_connection call; but most drivers don't need this and won't have it so we'll fail for the error described in the pylint output above.

Changed in cinder:
importance: Undecided → Critical
assignee: nobody → John Griffith (john-griffith)
status: New → Triaged
tags: added: icehouse-backport-potential
tags: added: juno-backport-potential
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/141660

Changed in cinder:
status: Triaged → In Progress
Mike Perez (thingee)
Changed in cinder:
milestone: none → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/141660
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=7095e1c5a7477ca77c8698d96a969a7d78090a18
Submitter: Jenkins
Branch: master

commit 7095e1c5a7477ca77c8698d96a969a7d78090a18
Author: John Griffith <email address hidden>
Date: Sun Dec 14 12:02:30 2014 -0700

    Remove iscsi_helper calls from base iscsi driver

    There are a number of drivers that inherit from the base
    iscsi driver, using the base implementation of initialize_connection
    and terminate_connection. These drivers also don't have iscsi_helper
    defined.

    We've kept all iscsi_helper specific code in the tgt helpers
    themselves, or in the various versions of the LVM driver
    which is where they belong.

    Over time however there have been some iscsi_helper specific
    calls that have crept in to the base volume.driver:ISCSIDriver
    class. These were LIO specific calls and as a result when a
    configuration is set with multi-backend to use lioadm as the
    target helper, or even if it's not used but the default iscsi_helper
    is set to lioadm the initialize_connection and terminate_connection
    calls will try and access the LIO specific calls and raise because
    the drivers inheriting from this class don't have target_helper
    members.

    This went unnoticed mostly because there's no significant LIO testing
    in place and there were no distros setting LIO as the default iscsi_helper,
    it appears that this has changed however.

    This patch moves the LIO specific calls back where they belong
    and keeps the base ISCSIDriver generic. I've also added a test
    case for this in the SolidFire driver because it's impacted by
    this.

    Change-Id: Ibe010b62bb2518685753dd515326e56ffcc99cea
    Closes-Bug: #1400804

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/183464

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

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/183465

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/juno)

Reviewed: https://review.openstack.org/183465
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=9c0a64f3d7153bc262ce4fa0280a895992a9994f
Submitter: Jenkins
Branch: stable/juno

commit 9c0a64f3d7153bc262ce4fa0280a895992a9994f
Author: John Griffith <email address hidden>
Date: Sun Dec 14 12:02:30 2014 -0700

    Remove iscsi_helper calls from base iscsi driver

    There are a number of drivers that inherit from the base
    iscsi driver, using the base implementation of initialize_connection
    and terminate_connection. These drivers also don't have iscsi_helper
    defined.

    We've kept all iscsi_helper specific code in the tgt helpers
    themselves, or in the various versions of the LVM driver
    which is where they belong.

    Over time however there have been some iscsi_helper specific
    calls that have crept in to the base volume.driver:ISCSIDriver
    class. These were LIO specific calls and as a result when a
    configuration is set with multi-backend to use lioadm as the
    target helper, or even if it's not used but the default iscsi_helper
    is set to lioadm the initialize_connection and terminate_connection
    calls will try and access the LIO specific calls and raise because
    the drivers inheriting from this class don't have target_helper
    members.

    This went unnoticed mostly because there's no significant LIO testing
    in place and there were no distros setting LIO as the default iscsi_helper,
    it appears that this has changed however.

    This patch moves the LIO specific calls back where they belong
    and keeps the base ISCSIDriver generic. I've also added a test
    case for this in the SolidFire driver because it's impacted by
    this.

    Change-Id: Ibe010b62bb2518685753dd515326e56ffcc99cea
    Closes-Bug: #1400804
    (cherry picked from commit 7095e1c5a7477ca77c8698d96a969a7d78090a18)

tags: added: in-stable-juno
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/icehouse)

Change abandoned by Gorka Eguileor (<email address hidden>) on branch: stable/icehouse
Review: https://review.openstack.org/183464
Reason: Icehouse is on Security Patches only.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.