Merge "Pass token and endpoint to swift os_options"
This commit is contained in:
@@ -610,7 +610,11 @@ class OpenStackCloud(object):
|
||||
self._swift_client = swift_client.Connection(
|
||||
preauthurl=endpoint,
|
||||
preauthtoken=token,
|
||||
os_options=dict(region_name=self.region_name),
|
||||
auth_version=self.api_versions['identity'],
|
||||
os_options=dict(
|
||||
auth_token=token,
|
||||
object_storage_url=endpoint,
|
||||
region_name=self.region_name),
|
||||
)
|
||||
except OpenStackCloudException:
|
||||
raise
|
||||
|
||||
@@ -36,9 +36,14 @@ class TestShade(base.TestCase):
|
||||
endpoint_mock.return_value = 'danzig'
|
||||
auth_mock.return_value = 'yankee'
|
||||
self.cloud.swift_client
|
||||
swift_mock.assert_called_with(preauthurl='danzig',
|
||||
preauthtoken='yankee',
|
||||
os_options=mock.ANY)
|
||||
swift_mock.assert_called_with(
|
||||
preauthurl='danzig',
|
||||
preauthtoken='yankee',
|
||||
auth_version='2',
|
||||
os_options=dict(
|
||||
object_storage_url='danzig',
|
||||
auth_token='yankee',
|
||||
region_name=''))
|
||||
|
||||
@mock.patch.object(shade.OpenStackCloud, 'auth_token',
|
||||
new_callable=mock.PropertyMock)
|
||||
|
||||
Reference in New Issue
Block a user