From: Victor Stinner Date: Tue, 1 Dec 2015 10:00:03 +0000 (+0100) Subject: xio: fix regression in authentication X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=acdf1f6ad5bcf29bcbf9b81a2debec24eca05548;p=openstack-build%2Fcinder-build.git 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 --- 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