# -*- coding: utf-8 -*-
+
from __future__ import absolute_import
import json
self._refresh_health_checks()
@no_type_check
- def handler(self, action):
+ def handler(self, action: Actions):
'''
Control and report debug status in Ceph-Dashboard
'''
ret = 0
msg = ''
- if action in [Actions.ENABLE.value, Actions.DISABLE.value]:
- self.set_option(self.NAME, action == Actions.ENABLE.value)
+ if action in [Actions.ENABLE, Actions.DISABLE]:
+ self.set_option(self.NAME, action == Actions.ENABLE)
self.mgr.update_cherrypy_config({})
self._refresh_health_checks()
else:
COMMANDS = [
SP.Command(
prefix="dashboard {name}".format(name=NAME),
- args="name=action,type=CephChoices,strings={states}".format(
- states="|".join(a.value for a in Actions)),
handler=handler
)
]