From acdf1f6ad5bcf29bcbf9b81a2debec24eca05548 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 1 Dec 2015 11:00:03 +0100 Subject: [PATCH] xio: fix regression in authentication The change I75a5dee2fd1f8cf45dbf416b0353736a43efd8e8 replaced base64.encodestring(auth_key)[:-1] with oslo_serialization.base64.encode_as_text(auth_key)[:-1]. It's wrong because base64.encodestring() adds '\n' to the output, wheras oslo_serialization.base64.encode_as_text() doesn't add '\n'. This change removes '[:-1]' to strip the newline, it's no more needed. Partial-Implements: blueprint cinder-python3 Change-Id: Ib015a850d7cc2e1259518fecfe66c836002b28d9 --- cinder/volume/drivers/xio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/volume/drivers/xio.py b/cinder/volume/drivers/xio.py index b85ed4cbb..c3b4d95bf 100644 --- a/cinder/volume/drivers/xio.py +++ b/cinder/volume/drivers/xio.py @@ -367,7 +367,7 @@ class XIOISEDriver(object): auth_key = ('%s:%s' % (self.configuration.san_login, self.configuration.san_password)) - auth_key = base64.encode_as_text(auth_key)[:-1] + auth_key = base64.encode_as_text(auth_key) header['Authorization'] = 'Basic %s' % auth_key # We allow 5 retries on each IP address. If connection to primary # fails, secondary will be tried. If connection to secondary is -- 2.45.2