From 0565732a161ccc8bbef729019f7a24f2d862e606 Mon Sep 17 00:00:00 2001 From: Chris M Date: Fri, 18 Jan 2019 02:13:21 +0000 Subject: [PATCH] Fix for HPE MSA 2050 login failures When authenticating to the array, use the 'response-type-numeric' value to determine success, rather than doing a string match against the 'response-type' string, which is not guaranteed to be consistent. Change-Id: I47fe1ff2dd5e24fffd5118aeab9473774eb58a61 Closes-Bug: #1808968 --- cinder/volume/drivers/dothill/dothill_client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cinder/volume/drivers/dothill/dothill_client.py b/cinder/volume/drivers/dothill/dothill_client.py index 3b06813533e..27fa7539ad5 100644 --- a/cinder/volume/drivers/dothill/dothill_client.py +++ b/cinder/volume/drivers/dothill/dothill_client.py @@ -56,10 +56,12 @@ class DotHillClient(object): self._session_key = None try: tree = etree.XML(xml) - if (tree.findtext(".//PROPERTY[@name='response-type']") == - "success"): - self._session_key = ( - tree.findtext(".//PROPERTY[@name='response']")) + # The 'return-code' property is not valid in this context, so we + # we check value of 'response-type-numeric' (0 => Success) + rtn = tree.findtext(".//PROPERTY[@name='response-type-numeric']") + session_key = tree.findtext(".//PROPERTY[@name='response']") + if rtn == '0': + self._session_key = session_key except Exception as e: msg = _("Cannot parse session key: %s") % e.msg raise exception.DotHillConnectionError(message=msg)