Merge "Pass token and endpoint to swift os_options"

This commit is contained in:
Jenkins
2015-06-18 14:28:43 +00:00
committed by Gerrit Code Review
2 changed files with 13 additions and 4 deletions

View File

@@ -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

View File

@@ -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)