Merge "Encode username and password for basic auth"
This commit is contained in:
commit
62a07420a0
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user