"desc": "Clear health checks by name. If no names provided, clear all.",
"perm": "rw"
},
+ {
+ "cmd": "mgr self-test insights_set_now_offset name=hours,type=CephString",
+ "desc": "Set the now time for the insights module.",
+ "perm": "rw"
+ },
]
def __init__(self, *args, **kwargs):
return self._health_set(inbuf, command)
elif command['prefix'] == 'mgr self-test health clear':
return self._health_clear(inbuf, command)
+ elif command['prefix'] == 'mgr self-test insights_set_now_offset':
+ return self._insights_set_now_offset(inbuf, command)
else:
return (-errno.EINVAL, '',
"Command not found '{0}'".format(command['prefix']))
self.set_health_checks(self._health)
return 0, "", ""
+ def _insights_set_now_offset(self, inbuf, command):
+ try:
+ hours = long(command["hours"])
+ except Exception as e:
+ return -1, "", "Timestamp must be numeric: {}".format(e.message)
+
+ self.remote("insights", "testing_set_now_time_offset", hours)
+ return 0, "", ""
+
def _self_test(self):
self.log.info("Running self-test procedure...")