From: abhiram moturi Date: Sat, 19 Dec 2015 17:31:10 +0000 (+0000) Subject: Fix bugs caused by porting to python3 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=dd0b713a5a21c79adc7860a5b42a0fc5f99f56eb;p=openstack-build%2Fcinder-build.git Fix bugs caused by porting to python3 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 --- diff --git a/cinder/volume/drivers/zfssa/zfssaiscsi.py b/cinder/volume/drivers/zfssa/zfssaiscsi.py index edeb4a833..a90d71def 100644 --- a/cinder/volume/drivers/zfssa/zfssaiscsi.py +++ b/cinder/volume/drivers/zfssa/zfssaiscsi.py @@ -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 diff --git a/cinder/volume/drivers/zfssa/zfssanfs.py b/cinder/volume/drivers/zfssa/zfssanfs.py index 0b07060bc..3cb3cd481 100644 --- a/cinder/volume/drivers/zfssa/zfssanfs.py +++ b/cinder/volume/drivers/zfssa/zfssanfs.py @@ -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,