diff --git a/vmware_nsxlib/tests/unit/v3/test_cluster.py b/vmware_nsxlib/tests/unit/v3/test_cluster.py index f5035d49..ed00105c 100644 --- a/vmware_nsxlib/tests/unit/v3/test_cluster.py +++ b/vmware_nsxlib/tests/unit/v3/test_cluster.py @@ -74,7 +74,9 @@ class RequestsHTTPProviderTestCase(unittest.TestCase): mock_api, cluster.Provider('9.8.7.6', 'https://9.8.7.6', 'nsxuser', password, None)) - self.assertEqual(('nsxuser', password), session.auth) + self.assertEqual(('nsxuser'.encode('utf-8'), + password.encode('utf-8')), + session.auth) self.assertFalse(session.verify) self.assertIsNone(session.cert) self.assertEqual(100, diff --git a/vmware_nsxlib/v3/cluster.py b/vmware_nsxlib/v3/cluster.py index 0c809ee5..88996512 100644 --- a/vmware_nsxlib/v3/cluster.py +++ b/vmware_nsxlib/v3/cluster.py @@ -214,7 +214,8 @@ class NSXRequestsHTTPProvider(AbstractHTTPProvider): # Set the headers with Auth info when token provider is set, # otherwise set the username and password elif not config.token_provider: - session.auth = (provider.username, provider.password) + session.auth = (provider.username.encode('utf-8'), + provider.password.encode('utf-8')) # NSX v3 doesn't use redirects session.max_redirects = 0