From 205b6e48b2cad7739c9d6797ccd3e5daa3332738 Mon Sep 17 00:00:00 2001 From: Felipe Sanches Zanoni Date: Tue, 30 Nov 2021 14:07:33 -0500 Subject: [PATCH] Fix mgr-restful-plugin not running correctly After upgrading to ceph nautilus, the mgr-restful-plugin log shows a message of command failure when running 'ceph config-key get config/mgr/restful/controller-0/crt'. This happens on both controllers and can lead to spotty access by components that need REST API access. Changing the path to the certificate from 'config/mgr/restful/controller-0/crt' to 'config/mgr/mgr/restful/controller-0/crt' and the path to the key from 'config/mgr/restful/controller-0/key' to 'config/mgr/mgr/restful/controller-0/key' fixed the problem Test plan: - Tested on AIO-DX Story: 2009074 Task: 44100 Signed-off-by: Felipe Sanches Zanoni Change-Id: Ifb0d3c7b8b3669472ef3b579951b9850fdf4bbbc --- ceph/ceph/files/mgr-restful-plugin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ceph/ceph/files/mgr-restful-plugin.py b/ceph/ceph/files/mgr-restful-plugin.py index 1ab6507e5..ef5e77e4b 100644 --- a/ceph/ceph/files/mgr-restful-plugin.py +++ b/ceph/ceph/files/mgr-restful-plugin.py @@ -770,7 +770,7 @@ class ServiceMonitor(object): try: self.run_with_timeout( ['/usr/bin/ceph', 'config-key', 'get', - 'config/mgr/restful/{}/crt'.format(CONFIG.ceph_mgr_identity)], + 'config/mgr/mgr/restful/{}/crt'.format(CONFIG.ceph_mgr_identity)], CONFIG.ceph_cli_timeout_sec) self.run_with_timeout( ['/usr/bin/ceph', 'config-key', 'get', @@ -778,7 +778,7 @@ class ServiceMonitor(object): CONFIG.ceph_cli_timeout_sec) self.run_with_timeout( ['/usr/bin/ceph', 'config-key', 'get', - 'config/mgr/restful/{}/key'.format(CONFIG.ceph_mgr_identity)], + 'config/mgr/mgr/restful/{}/key'.format(CONFIG.ceph_mgr_identity)], CONFIG.ceph_cli_timeout_sec) self.run_with_timeout( ['/usr/bin/ceph', 'config-key', 'get', @@ -824,7 +824,7 @@ class ServiceMonitor(object): out=err.output) self.run_with_timeout( ['/usr/bin/ceph', 'config-key', 'set', - 'config/mgr/restful/{}/crt'.format(CONFIG.ceph_mgr_identity), + 'config/mgr/mgr/restful/{}/crt'.format(CONFIG.ceph_mgr_identity), '-i', os.path.join(path, 'crt')], CONFIG.ceph_cli_timeout_sec) self.run_with_timeout( @@ -834,7 +834,7 @@ class ServiceMonitor(object): CONFIG.ceph_cli_timeout_sec) self.run_with_timeout( ['/usr/bin/ceph', 'config-key', 'set', - 'config/mgr/restful/{}/key'.format(CONFIG.ceph_mgr_identity), + 'config/mgr/mgr/restful/{}/key'.format(CONFIG.ceph_mgr_identity), '-i', os.path.join(path, 'key')], CONFIG.ceph_cli_timeout_sec) self.run_with_timeout( @@ -891,7 +891,7 @@ class ServiceMonitor(object): def restful_plugin_get_certificate(self): command = ['/usr/bin/ceph', 'config-key', 'get', - 'config/mgr/restful/{}/crt'.format(CONFIG.ceph_mgr_identity)] + 'config/mgr/mgr/restful/{}/crt'.format(CONFIG.ceph_mgr_identity)] with open(os.devnull, 'wb') as null: certificate = self.run_with_timeout( command, CONFIG.ceph_cli_timeout_sec, stderr=null)