diff --git a/cinder/compute/nova.py b/cinder/compute/nova.py index e7cc70955f4..4d93a377b84 100644 --- a/cinder/compute/nova.py +++ b/cinder/compute/nova.py @@ -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) diff --git a/cinder/tests/unit/compute/test_nova.py b/cinder/tests/unit/compute/test_nova.py index 4d4a6dc471e..2c69b6b041f 100644 --- a/cinder/tests/unit/compute/test_nova.py +++ b/cinder/tests/unit/compute/test_nova.py @@ -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',