switch to using new versions of cinder service
cinder v1 is deprecated now. switching to v2. Change-Id: I1a9f3de37c8a53ce99277d4c1bd83c9f24f1b9ef
This commit is contained in:
parent
6db2a7f130
commit
3a39d4d5f8
|
@ -48,6 +48,8 @@ def create_snapshot(context, volume_id, description=None):
|
|||
cleaner.addCleanup(db_api.delete_item, context, snapshot['id'])
|
||||
os_snapshot.update(display_name=snapshot['id'],
|
||||
display_description=description)
|
||||
# NOTE(andrey-mp): to re-read description in version dependent format
|
||||
os_snapshot.get()
|
||||
|
||||
return _format_snapshot(context, snapshot, os_snapshot,
|
||||
volume_id=volume_id)
|
||||
|
|
|
@ -42,7 +42,7 @@ ec2_opts = [
|
|||
'If it is obsolete v2, a lot of useful EC2 compliant '
|
||||
'instance properties will be unavailable.'),
|
||||
cfg.StrOpt('cinder_service_type',
|
||||
default='volume',
|
||||
default='volumev2',
|
||||
help='Service type of Volume API, registered in Keystone '
|
||||
'catalog.'),
|
||||
# TODO(andrey-mp): keystone v3 allows to pass domain_name
|
||||
|
|
|
@ -56,7 +56,7 @@ def create_context(is_os_admin=False):
|
|||
if is_os_admin else
|
||||
mock.sentinel.session)
|
||||
session.get_endpoint = mock.Mock(name="get_endpoint")
|
||||
session.get_endpoint.return_value = 'v1'
|
||||
session.get_endpoint.return_value = 'v2'
|
||||
return ec2api.context.RequestContext(fakes.ID_OS_USER, fakes.ID_OS_PROJECT,
|
||||
is_os_admin=is_os_admin,
|
||||
session=session)
|
||||
|
@ -118,7 +118,7 @@ class MockOSMixin(object):
|
|||
|
||||
def mock_cinder(self):
|
||||
cinder_patcher = mock.patch('cinderclient.client.Client')
|
||||
cinder = mock.create_autospec(cinderclient.Client('1'))
|
||||
cinder = mock.create_autospec(cinderclient.Client('2'))
|
||||
cinder_patcher.start().return_value = cinder
|
||||
self.addCleanup(cinder_patcher.stop)
|
||||
return cinder
|
||||
|
|
|
@ -116,7 +116,7 @@ class ClientsTestCase(base.BaseTestCase):
|
|||
context = mock.NonCallableMock(session=mock.sentinel.session)
|
||||
res = clients.cinder(context)
|
||||
self.assertEqual(cinder.return_value, res)
|
||||
cinder.assert_called_with('1', service_type='volume',
|
||||
cinder.assert_called_with('2', service_type='volumev2',
|
||||
session=mock.sentinel.session)
|
||||
|
||||
@mock.patch('keystoneclient.client.Client')
|
||||
|
@ -124,5 +124,5 @@ class ClientsTestCase(base.BaseTestCase):
|
|||
context = mock.NonCallableMock(session=mock.sentinel.session)
|
||||
res = clients.keystone(context)
|
||||
self.assertEqual(keystone.return_value, res)
|
||||
keystone.assert_called_with(auth_url='v1',
|
||||
keystone.assert_called_with(auth_url='v2',
|
||||
session=mock.sentinel.session)
|
||||
|
|
Loading…
Reference in New Issue