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 <Felipe.SanchesZanoni@windriver.com>
Change-Id: Ifb0d3c7b8b3669472ef3b579951b9850fdf4bbbc
This commit is contained in:
Felipe Sanches Zanoni 2021-11-30 14:07:33 -05:00
parent 8834ecfadc
commit 205b6e48b2

View File

@ -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)