From 9c511843104ef852757c947241393a32447d0e34 Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Sun, 5 Mar 2017 09:35:33 -0500 Subject: [PATCH] Remove unused "share_id" parameter in "revert_to_snapshot" share service api. Change-Id: I8f876ff78ccb9734ecd754d1ddde8f9d724ae8ca Closes-Bug: #1662572 --- manila/share/manager.py | 5 ++--- manila/share/rpcapi.py | 6 +++--- manila/tests/share/test_rpcapi.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/manila/share/manager.py b/manila/share/manager.py index 990c5858..c841864f 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -190,7 +190,7 @@ def add_hooks(f): class ShareManager(manager.SchedulerDependentManager): """Manages NAS storages.""" - RPC_API_VERSION = '1.17' + RPC_API_VERSION = '1.18' def __init__(self, share_driver=None, service_name=None, *args, **kwargs): """Load the driver from args, or from flags.""" @@ -2453,8 +2453,7 @@ class ShareManager(manager.SchedulerDependentManager): @add_hooks @utils.require_driver_initialized def revert_to_snapshot(self, context, snapshot_id, - reservations, share_id=None): - # TODO(bswartz) fix bug 1662572 and remove share_id + reservations): context = context.elevated() snapshot = self.db.share_snapshot_get(context, snapshot_id) share = snapshot['share'] diff --git a/manila/share/rpcapi.py b/manila/share/rpcapi.py index 947f922f..19c33506 100644 --- a/manila/share/rpcapi.py +++ b/manila/share/rpcapi.py @@ -74,6 +74,7 @@ class ShareAPI(object): create_share_group, delete_share_group create_share_group_snapshot, and delete_share_group_snapshot 1.17 - Add snapshot_update_access() + 1.18 - Remove unused "share_id" parameter from revert_to_snapshot() """ BASE_RPC_API_VERSION = '1.0' @@ -82,7 +83,7 @@ class ShareAPI(object): super(ShareAPI, self).__init__() target = messaging.Target(topic=CONF.share_topic, version=self.BASE_RPC_API_VERSION) - self.client = rpc.get_client(target, version_cap='1.17') + self.client = rpc.get_client(target, version_cap='1.18') def create_share_instance(self, context, share_instance, host, request_spec, filter_properties, @@ -128,10 +129,9 @@ class ShareAPI(object): def revert_to_snapshot(self, context, share, snapshot, host, reservations): host = utils.extract_host(host) - call_context = self.client.prepare(server=host, version='1.13') + call_context = self.client.prepare(server=host, version='1.18') call_context.cast(context, 'revert_to_snapshot', - share_id=share['id'], snapshot_id=snapshot['id'], reservations=reservations) diff --git a/manila/tests/share/test_rpcapi.py b/manila/tests/share/test_rpcapi.py index 206fd0f9..58096224 100644 --- a/manila/tests/share/test_rpcapi.py +++ b/manila/tests/share/test_rpcapi.py @@ -326,7 +326,7 @@ class ShareRpcAPITestCase(test.TestCase): def test_revert_to_snapshot(self): self._test_share_api('revert_to_snapshot', rpc_method='cast', - version='1.13', + version='1.18', share=self.fake_share, snapshot=self.fake_snapshot, host='fake_host',