From faf0998be7099f7e80384a50782d86a6f720d144 Mon Sep 17 00:00:00 2001 From: moontaek-rho Date: Wed, 14 Jun 2023 13:49:40 +0900 Subject: [PATCH] title: Update oslo_messaging_RPCClient and get_rpc_transport in neutron oslo_messaging.RPCClient and get_transport is deprecated in antelop version (2023.1).This change moves the health prove to use get_rpc_client and get_rpc_transport instead. story: 2010792 task: 48229 Change-Id: I870619626e1bfe6f40f293c01835dac6157947d7 --- neutron/Chart.yaml | 2 +- neutron/templates/bin/_health-probe.py.tpl | 13 +++++++++---- releasenotes/notes/neutron.yaml | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/neutron/Chart.yaml b/neutron/Chart.yaml index bb53e5302a..6fdec11791 100644 --- a/neutron/Chart.yaml +++ b/neutron/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Neutron name: neutron -version: 0.3.11 +version: 0.3.12 home: https://docs.openstack.org/neutron/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png sources: diff --git a/neutron/templates/bin/_health-probe.py.tpl b/neutron/templates/bin/_health-probe.py.tpl index 266c3d8d3c..897b735267 100644 --- a/neutron/templates/bin/_health-probe.py.tpl +++ b/neutron/templates/bin/_health-probe.py.tpl @@ -68,9 +68,14 @@ def check_agent_status(transport): target = oslo_messaging.Target( topic=cfg.CONF.agent_queue_name, server=_get_hostname(use_fqdn)) - client = oslo_messaging.RPCClient(transport, target, - timeout=rpc_timeout, - retry=rpc_retries) + if hasattr(oslo_messaging, 'get_rpc_client'): + client = oslo_messaging.get_rpc_client(transport, target, + timeout=rpc_timeout, + retry=rpc_retries) + else: + client = oslo_messaging.RPCClient(transport, target, + timeout=rpc_timeout, + retry=rpc_retries) client.call(context.RequestContext(), 'pod_health_probe_method_ignore_errors') except oslo_messaging.exceptions.MessageDeliveryFailure: @@ -271,7 +276,7 @@ def test_rpc_liveness(): cfg.CONF(sys.argv[1:]) try: - transport = oslo_messaging.get_transport(cfg.CONF) + transport = oslo_messaging.get_rpc_transport(cfg.CONF) except Exception as ex: message = getattr(ex, "message", str(ex)) sys.stderr.write("Message bus driver load error: %s" % message) diff --git a/releasenotes/notes/neutron.yaml b/releasenotes/notes/neutron.yaml index 3ab7451c2b..46051035b8 100644 --- a/releasenotes/notes/neutron.yaml +++ b/releasenotes/notes/neutron.yaml @@ -53,4 +53,5 @@ neutron: - 0.3.9 Extend neutron liveness probe with readiness probe - 0.3.10 Configure keystone authentication credentials for placement - 0.3.11 Add Zed overrides + - 0.3.12 Update oslo_messaging_RPCClient and get_rpc_transport ...