From 27379674307d3cd24c5440b2917a21258feefb29 Mon Sep 17 00:00:00 2001 From: Erickson Silva de Oliveira Date: Tue, 4 Jul 2023 14:29:37 +0000 Subject: [PATCH] Fix use of ceph_mgr_lifecycle_days variable The change [1] added a syntax issue where it was not possible to use the variable ceph_mgr_lifecycle_days. Analyzing the code, it was possible to observe that the ceph_mgr_lifecycle_days variable is part of the Config class, not of the ServiceMonitor. So to fix the problem, just replace the use of 'self' with CONFIG. Test Plan: PASS: AIO-SX fresh install PASS: Notice that there are no errors in the log /var/log/mgr-restful-plugin.log Closes-Bug: 2023553 [1]: https://review.opendev.org/c/starlingx/integ/+/885881 Change-Id: Icb46f1589057607e24123b69e9ab44994580585a Signed-off-by: Erickson Silva de Oliveira --- ceph/ceph/files/mgr-restful-plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceph/ceph/files/mgr-restful-plugin.py b/ceph/ceph/files/mgr-restful-plugin.py index eff0970ee..98b5abe90 100644 --- a/ceph/ceph/files/mgr-restful-plugin.py +++ b/ceph/ceph/files/mgr-restful-plugin.py @@ -578,8 +578,8 @@ class ServiceMonitor(object): # REST API should be available now # start making periodic requests (ping) while True: - if self.ceph_mgr_lifecycle_days != -1 \ - and self.ceph_mgr_uptime() >= self.ceph_mgr_lifecycle_days: + if CONFIG.ceph_mgr_lifecycle_days != -1 \ + and self.ceph_mgr_uptime() >= CONFIG.ceph_mgr_lifecycle_days: self.ceph_mgr_start_date = None LOG.info("Restarting ceph-mgr to control RSS memory growth") self.ceph_mgr_restart()