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
This commit is contained in:
abhiram moturi
2015-12-19 17:31:10 +00:00
parent c9c1e91405
commit dd0b713a5a
2 changed files with 3 additions and 3 deletions

View 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

View 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,