Merge "Fix the interface to call update_server_volume"

This commit is contained in:
Jenkins 2016-08-28 20:50:06 +00:00 committed by Gerrit Code Review
commit 5a8c1affa1
2 changed files with 7 additions and 4 deletions

View File

@ -175,9 +175,10 @@ class API(base.Base):
def update_server_volume(self, context, server_id, attachment_id,
new_volume_id):
novaclient(context).volumes.update_server_volume(server_id,
attachment_id,
new_volume_id)
nova = novaclient(context, admin_endpoint=True, privileged_user=True)
nova.volumes.update_server_volume(server_id,
attachment_id,
new_volume_id)
def create_volume_snapshot(self, context, volume_id, create_info):
nova = novaclient(context, admin_endpoint=True, privileged_user=True)

View File

@ -162,7 +162,9 @@ class NovaApiTestCase(test.TestCase):
self.api.update_server_volume(self.ctx, 'server_id',
'attach_id', 'new_volume_id')
mock_novaclient.assert_called_once_with(self.ctx)
mock_novaclient.assert_called_once_with(self.ctx,
admin_endpoint=True,
privileged_user=True)
mock_update_server_volume.assert_called_once_with(
'server_id',
'attach_id',