From f83ebe6a0edc1aa1ea762635c3df6bf166075464 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Tue, 5 Dec 2023 06:37:52 -0800 Subject: [PATCH] Remove unused rpc calls These RPC calls were only used internally and does not need to be exposed as RPC calls. The following rpc calls were removed. - find_records - find_recordset - update_zone_import Change-Id: I0dd7c77def9a9d41a518b92b9a662a0e1fce1e3e --- designate/central/rpcapi.py | 19 +++---------------- designate/central/service.py | 6 +----- .../unused-rpc-calls-7df4dcbcc19c6f60.yaml | 11 +++++++++++ 3 files changed, 15 insertions(+), 21 deletions(-) create mode 100644 releasenotes/notes/unused-rpc-calls-7df4dcbcc19c6f60.yaml diff --git a/designate/central/rpcapi.py b/designate/central/rpcapi.py index 1e88f4685..dee3d20d6 100644 --- a/designate/central/rpcapi.py +++ b/designate/central/rpcapi.py @@ -71,8 +71,9 @@ class CentralAPI: 6.6 - Add methods for shared zones 6.7 - Add increment_zone_serial 6.8 - Add managed recordset methods + 6.9 - Removed unused methods """ - RPC_API_VERSION = '6.8' + RPC_API_VERSION = '6.9' # This allows us to mark some methods as not logged. # This can be for a few reasons - some methods my not actually call over @@ -85,7 +86,7 @@ class CentralAPI: target = messaging.Target(topic=self.topic, version=self.RPC_API_VERSION) - self.client = rpc.get_client(target, version_cap='6.8') + self.client = rpc.get_client(target, version_cap='6.9') @classmethod def get_instance(cls): @@ -230,9 +231,6 @@ class CentralAPI: limit=limit, sort_key=sort_key, sort_dir=sort_dir, force_index=force_index) - def find_recordset(self, context, criterion=None): - return self.client.call(context, 'find_recordset', criterion=criterion) - def create_managed_records(self, context, zone_id, records_values, recordset_values): return self.client.call(context, 'create_managed_records', @@ -259,13 +257,6 @@ class CentralAPI: recordset_id=recordset_id, increment_serial=increment_serial) - # Record Methods - def find_records(self, context, criterion=None, marker=None, limit=None, - sort_key=None, sort_dir=None): - return self.client.call(context, 'find_records', criterion=criterion, - marker=marker, limit=limit, sort_key=sort_key, - sort_dir=sort_dir) - # Misc. Report combining counts for tenants, zones and records def count_report(self, context, criterion=None): return self.client.call(context, 'count_report', criterion=criterion) @@ -395,10 +386,6 @@ class CentralAPI: return self.client.call(context, 'get_zone_import', zone_import_id=zone_import_id) - def update_zone_import(self, context, zone_import): - return self.client.call(context, 'update_zone_import', - zone_import=zone_import) - def delete_zone_import(self, context, zone_import_id): return self.client.call(context, 'delete_zone_import', zone_import_id=zone_import_id) diff --git a/designate/central/service.py b/designate/central/service.py index 7f1de44e6..e769c654f 100644 --- a/designate/central/service.py +++ b/designate/central/service.py @@ -54,7 +54,7 @@ LOG = logging.getLogger(__name__) class Service(service.RPCService): - RPC_API_VERSION = '6.8' + RPC_API_VERSION = '6.9' target = messaging.Target(version=RPC_API_VERSION) @@ -1522,9 +1522,7 @@ class Service(service.RPCService): return recordsets - @rpc.expected_exceptions() def find_recordset(self, context, criterion=None): - # TODO(johnsom) Fix this to be useful if policy.enforce_new_defaults(): target = {constants.RBAC_PROJECT_ID: context.project_id} @@ -1767,7 +1765,6 @@ class Service(service.RPCService): return self.storage.count_recordsets(context, criterion) # Record Methods - @rpc.expected_exceptions() def find_records(self, context, criterion=None, marker=None, limit=None, sort_key=None, sort_dir=None): @@ -2814,7 +2811,6 @@ class Service(service.RPCService): self.update_zone_import(context, zone_import) - @rpc.expected_exceptions() @notification.notify_type('dns.zone_import.update') def update_zone_import(self, context, zone_import): if policy.enforce_new_defaults(): diff --git a/releasenotes/notes/unused-rpc-calls-7df4dcbcc19c6f60.yaml b/releasenotes/notes/unused-rpc-calls-7df4dcbcc19c6f60.yaml new file mode 100644 index 000000000..e62b7b1e8 --- /dev/null +++ b/releasenotes/notes/unused-rpc-calls-7df4dcbcc19c6f60.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - | + Removed the following unused central rpc calls. This should not impact + normal installations, but if these are used in any custom written backends + or plugins that you are using, you will need to update your code before + upgrading. + + - ``find_records`` + - ``find_recordset`` + - ``update_zone_import``