summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/module.py
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2020-12-27 05:47:02 +0100
committerKefu Chai <kchai@redhat.com>2021-01-15 02:18:07 +0100
commit3c431a54d96ebc9bdb911161468d0f6bedbbcbfe (patch)
treec2d252f5a8a5cce65a83b9b4a33a816860b58bf1 /src/pybind/mgr/dashboard/module.py
parentpybind/mgr/mgr_module: use 'not in' for checking membership (diff)
downloadceph-3c431a54d96ebc9bdb911161468d0f6bedbbcbfe.tar.xz
ceph-3c431a54d96ebc9bdb911161468d0f6bedbbcbfe.zip
mgr/dashboard: use param annotation for args desc
use parameter annotation for CLICommand arg desc less repeating this way Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'src/pybind/mgr/dashboard/module.py')
-rw-r--r--src/pybind/mgr/dashboard/module.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py
index 0c902d909f1..087eda57380 100644
--- a/src/pybind/mgr/dashboard/module.py
+++ b/src/pybind/mgr/dashboard/module.py
@@ -14,6 +14,7 @@ import sys
import tempfile
import threading
import time
+from typing import Optional
from mgr_module import CLIWriteCommand, MgrModule, MgrStandbyModule, Option
from mgr_util import ServerConfigException, create_self_signed_cert, \
@@ -358,9 +359,10 @@ class Module(MgrModule, CherryPyConfig):
logger.info('Stopping engine...')
self.shutdown_event.set()
- @CLIWriteCommand("dashboard set-ssl-certificate",
- "name=mgr_id,type=CephString,req=false")
- def set_ssl_certificate(self, mgr_id=None, inbuf=None):
+ @CLIWriteCommand("dashboard set-ssl-certificate")
+ def set_ssl_certificate(self,
+ mgr_id: Optional[str] = None,
+ inbuf: Optional[bytes] = None):
if inbuf is None:
return -errno.EINVAL, '',\
'Please specify the certificate file with "-i" option'
@@ -370,9 +372,10 @@ class Module(MgrModule, CherryPyConfig):
self.set_store('crt', inbuf)
return 0, 'SSL certificate updated', ''
- @CLIWriteCommand("dashboard set-ssl-certificate-key",
- "name=mgr_id,type=CephString,req=false")
- def set_ssl_certificate_key(self, mgr_id=None, inbuf=None):
+ @CLIWriteCommand("dashboard set-ssl-certificate-key")
+ def set_ssl_certificate_key(self,
+ mgr_id: Optional[str] = None,
+ inbuf: Optional[bytes] = None):
if inbuf is None:
return -errno.EINVAL, '',\
'Please specify the certificate key file with "-i" option'