Merge "Fix last Python 3 issues in zonemanager"

This commit is contained in:
Jenkins 2016-02-19 16:49:08 +00:00 committed by Gerrit Code Review
commit 1fb4d17f2f
2 changed files with 4 additions and 13 deletions

View File

@ -19,6 +19,7 @@ HTTP or HTTPS protocol.
""" """
from oslo_log import log as logging from oslo_log import log as logging
from oslo_serialization import base64
import requests import requests
import six import six
import time import time
@ -158,8 +159,7 @@ class BrcdHTTPFCZoneClient(object):
# Form the authentication string # Form the authentication string
auth_string = (self.switch_user + ":" + self.switch_pwd + auth_string = (self.switch_user + ":" + self.switch_pwd +
":" + self.random_no) ":" + self.random_no)
auth_token = auth_string.encode( auth_token = base64.encode_as_text(auth_string).strip()
"base64", "strict").strip() # encode in base64 format
auth_header = (zone_constant.AUTH_STRING + auth_header = (zone_constant.AUTH_STRING +
auth_token) # Build the proper header auth_token) # Build the proper header
except Exception as e: except Exception as e:
@ -193,7 +193,7 @@ class BrcdHTTPFCZoneClient(object):
# Replace password in the authentication string with xxx # Replace password in the authentication string with xxx
auth_string = (self.switch_user + auth_string = (self.switch_user +
":" + "xxx" + ":" + self.random_no) ":" + "xxx" + ":" + self.random_no)
auth_token = auth_string.encode("base64", "strict").strip() auth_token = base64.encode_as_text(auth_string).strip()
auth_header = zone_constant.AUTH_STRING + auth_token auth_header = zone_constant.AUTH_STRING + auth_token
return True, auth_header return True, auth_header
else: else:

View File

@ -153,13 +153,4 @@ cinder.tests.unit.windows.test_windows
cinder.tests.unit.windows.test_windows_remotefs cinder.tests.unit.windows.test_windows_remotefs
cinder.tests.unit.windows.test_windows_utils cinder.tests.unit.windows.test_windows_utils
cinder.tests.unit.wsgi cinder.tests.unit.wsgi
cinder.tests.unit.zonemanager.test_brcd_fc_san_lookup_service cinder.tests.unit.zonemanager
cinder.tests.unit.zonemanager.test_brcd_fc_zone_client_cli
cinder.tests.unit.zonemanager.test_brcd_fc_zone_driver
cinder.tests.unit.zonemanager.test_brcd_lookup_service
cinder.tests.unit.zonemanager.test_cisco_fc_san_lookup_service
cinder.tests.unit.zonemanager.test_cisco_fc_zone_client_cli
cinder.tests.unit.zonemanager.test_cisco_fc_zone_driver
cinder.tests.unit.zonemanager.test_cisco_lookup_service
cinder.tests.unit.zonemanager.test_fc_zone_manager
cinder.tests.unit.zonemanager.test_volume_driver