From 17d6a993fc17d533460c5f40f3908c708e057c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:17 +0200 Subject: Merging upstream version 18.2.3. Signed-off-by: Daniel Baumann --- src/pybind/mgr/dashboard/controllers/osd.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/pybind/mgr/dashboard/controllers/osd.py') diff --git a/src/pybind/mgr/dashboard/controllers/osd.py b/src/pybind/mgr/dashboard/controllers/osd.py index f6f8ce1f5..c9d141772 100644 --- a/src/pybind/mgr/dashboard/controllers/osd.py +++ b/src/pybind/mgr/dashboard/controllers/osd.py @@ -168,11 +168,18 @@ class Osd(RESTController): @RESTController.Collection('GET', version=APIVersion.EXPERIMENTAL) @ReadPermission def settings(self): - result = CephService.send_command('mon', 'osd dump') - return { - 'nearfull_ratio': result['nearfull_ratio'], - 'full_ratio': result['full_ratio'] + data = { + 'nearfull_ratio': -1, + 'full_ratio': -1 } + try: + result = CephService.send_command('mon', 'osd dump') + data['nearfull_ratio'] = result['nearfull_ratio'] + data['full_ratio'] = result['full_ratio'] + except TypeError: + logger.error( + 'Error setting nearfull_ratio and full_ratio:', exc_info=True) + return data def _get_operational_status(self, osd_id: int, removing_osd_ids: Optional[List[int]]): if removing_osd_ids is None: -- cgit v1.2.3