]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix bugs caused by porting to python3
authorabhiram moturi <abhiram.moturi@oracle.com>
Sat, 19 Dec 2015 17:31:10 +0000 (17:31 +0000)
committerabhiram moturi <abhiram.moturi@oracle.com>
Sat, 19 Dec 2015 17:31:10 +0000 (17:31 +0000)
In previous python version base64.encodestring() adds '\n'.
at the end. This is removed when we use oslo encode_as_text()
This causes a regression as we manually removed the last
character earlier. This fix removes manually deleting the
last character.

Change-Id: I746c9435e7b4ec2e8af831d46f708c152dffba4d
Closes-Bug: #1527841

cinder/volume/drivers/zfssa/zfssaiscsi.py
cinder/volume/drivers/zfssa/zfssanfs.py

index edeb4a833daf4f478ab969c5f9fcc46552ce2fd3..a90d71def0996757988c43f88bddb22d07618c76 100644 (file)
@@ -137,7 +137,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
         self.tgt_zfssa = factory_zfssa()
         self.zfssa.set_host(lcfg.san_ip, timeout=lcfg.zfssa_rest_timeout)
         auth_str = '%s:%s' % (lcfg.san_login, lcfg.san_password)
-        auth_str = base64.encode_as_text(auth_str)[:-1]
+        auth_str = base64.encode_as_text(auth_str)
         self.zfssa.login(auth_str)
 
         self.zfssa.create_project(lcfg.zfssa_pool, lcfg.zfssa_project,
@@ -402,7 +402,7 @@ class ZFSSAISCSIDriver(driver.ISCSIDriver):
         pool = lcfg.zfssa_pool
         project = lcfg.zfssa_project
         auth_str = '%s:%s' % (lcfg.san_login, lcfg.san_password)
-        auth_str = base64.encode_as_text(auth_str)[:-1]
+        auth_str = base64.encode_as_text(auth_str)
         zfssa_tgt_group = lcfg.zfssa_target_group
         repl_ip = lcfg.zfssa_replication_ip
 
index 0b07060bc6a43a0efef5aa64440f0c7a1f44cff9..3cb3cd4815d5bacf84b8ef87a0f77255ffb0776e 100644 (file)
@@ -134,7 +134,7 @@ class ZFSSANFSDriver(nfs.NfsDriver):
         self.zfssa = factory_zfssa()
         self.zfssa.set_host(host, timeout=lcfg.zfssa_rest_timeout)
 
-        auth_str = base64.encode_as_text('%s:%s' % (user, password))[:-1]
+        auth_str = base64.encode_as_text('%s:%s' % (user, password))
         self.zfssa.login(auth_str)
 
         self.zfssa.create_project(lcfg.zfssa_nfs_pool, lcfg.zfssa_nfs_project,