From 367f264100778717890b7fb69668e44f0a22d8ce Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 29 Jan 2021 10:30:19 +0800 Subject: [PATCH] pybind/mgr: silence flake8 warnings silence following warnings from flake8 * line too long (107 > 100 characters) [E501] Signed-off-by: Kefu Chai --- src/pybind/mgr/mgr_module.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 44a2c10f5d7..a6814dfa61b 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -378,7 +378,10 @@ class CLICommand(object): kwargs[k] = CephArgtype.cast_to(tp, v) return kwargs - def call(self, mgr: Any, cmd_dict: Dict[str, Any], inbuf: Optional[str] = None) -> HandleCommandResult: + def call(self, + mgr: Any, + cmd_dict: Dict[str, Any], + inbuf: Optional[str] = None) -> HandleCommandResult: kwargs = self._collect_args_by_argspec(cmd_dict) if inbuf: kwargs['inbuf'] = inbuf @@ -786,6 +789,9 @@ class MgrStandbyModule(ceph_module.BaseMgrStandbyModule, MgrModuleLoggingMixin): return r +HealthChecksT = Mapping[str, Mapping[str, Union[int, str, Sequence[str]]]] + + class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin): COMMANDS = [] # type: List[Any] MODULE_OPTIONS: List[Option] = [] @@ -1276,8 +1282,7 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin): """ self._ceph_send_command(result, svc_type, svc_id, command, tag, inbuf) - def set_health_checks(self, - checks: Mapping[str, Mapping[str, Union[int, str, Sequence[str]]]]) -> None: + def set_health_checks(self, checks: HealthChecksT) -> None: """ Set the module's current map of health checks. Argument is a dict of check names to info, in this form: @@ -1612,7 +1617,11 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin): return self._ceph_have_mon_connection() - def update_progress_event(self, evid: str, desc: str, progress: float, add_to_ceph_s: bool) -> None: + def update_progress_event(self, + evid: str, + desc: str, + progress: float, + add_to_ceph_s: bool) -> None: return self._ceph_update_progress_event(evid, desc, progress, add_to_ceph_s) def complete_progress_event(self, evid: str) -> None: -- 2.47.3