]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/devicehealth: return -1 if prediction plugin is not available
authorKefu Chai <kchai@redhat.com>
Wed, 27 Jan 2021 06:58:01 +0000 (14:58 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 27 Jan 2021 11:22:05 +0000 (19:22 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/devicehealth/module.py

index 9f3b2bf6f3ba6a1cd65c189400199764b8148770..14b7dfdacfc684311bce184e5c30cdec5b185a89 100644 (file)
@@ -646,6 +646,8 @@ class Module(MgrModule):
             can_run, _ = self.remote(plugin_name, 'can_run')
             if can_run:
                 return self.remote(plugin_name, 'predict_life_expectancy', devid=devid)
+            else:
+                return -1, '', f'{plugin_name} is not available'
         except:
             return -1, '', 'unable to invoke diskprediction local or remote plugin'
 
@@ -660,6 +662,8 @@ class Module(MgrModule):
             can_run, _ = self.remote(plugin_name, 'can_run')
             if can_run:
                 return self.remote(plugin_name, 'predict_all_devices')
+            else:
+                return -1, '', f'{plugin_name} is not available'
         except:
             return -1, '', 'unable to invoke diskprediction local or remote plugin'