]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
xio: fix regression in authentication
authorVictor Stinner <vstinner@redhat.com>
Tue, 1 Dec 2015 10:00:03 +0000 (11:00 +0100)
committerVictor Stinner <vstinner@redhat.com>
Tue, 1 Dec 2015 14:40:52 +0000 (14:40 +0000)
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

index b85ed4cbbbda70a6a7eb69e2c0f3cb52fbdf4273..c3b4d95bf13492dfa1ff0d3ee67692449159e30b 100644 (file)
@@ -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