Fixes the import for Lefthand driver

Review 145780 broke the lefthand driver.  The author and reviewers
did not even bother to look at the 3rd party CI results that clearly
showed that this patch broke the hplefthand driver, due to changing
the imports.  The change removed an import to one of the hplefthandclient
modules, which was then later accessed.

Reviewers, please check 3rd party CI when a cinder patch touches a driver.

Authors of patches, if you touch a driver, you need to check the 3rd party
CI failures and make sure your patch changes aren't causing the failures.

Change-Id: Ie38f77fc9498915651c476ea10bc7bd7f49e393d
Partial-Bug: 1407162
This commit is contained in:
Walter A. Boring IV 2015-02-26 11:43:13 -08:00
parent 785f4baee1
commit 851557c273
1 changed files with 7 additions and 7 deletions

View File

@ -16,6 +16,7 @@
"""HP LeftHand SAN ISCSI REST Proxy."""
from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import units
from cinder import context
@ -28,11 +29,10 @@ from cinder.volume import volume_types
LOG = logging.getLogger(__name__)
try:
import hplefthandclient
hplefthandclient = importutils.try_import("hplefthandclient")
if hplefthandclient:
from hplefthandclient import client as hp_lh_client
from hplefthandclient import exceptions as hpexceptions
except ImportError:
import cinder.tests.fake_hp_lefthand_client as hplefthandclient
hplefthand_opts = [
cfg.StrOpt('hplefthand_api_url',
@ -120,7 +120,7 @@ class HPLeftHandRESTProxy(driver.ISCSIDriver):
client.logout()
def _create_client(self):
return hplefthandclient.client.HPLeftHandClient(
return hp_lh_client.HPLeftHandClient(
self.configuration.hplefthand_api_url)
def do_setup(self, context):
@ -321,8 +321,8 @@ class HPLeftHandRESTProxy(driver.ISCSIDriver):
iscsi_properties = self._get_iscsi_properties(volume)
if ('chapAuthenticationRequired' in server_info
and server_info['chapAuthenticationRequired']):
if ('chapAuthenticationRequired' in server_info and
server_info['chapAuthenticationRequired']):
iscsi_properties['auth_method'] = 'CHAP'
iscsi_properties['auth_username'] = connector['initiator']
iscsi_properties['auth_password'] = (