From: Sebastian Wagner Date: Fri, 20 Nov 2020 10:51:07 +0000 (+0100) Subject: mgr/cephadm: make annotations for upgrade.py mandatory X-Git-Tag: v15.2.9~88^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ba156aa5b18bd410ef6f65054fbe82df6415d68;p=ceph.git mgr/cephadm: make annotations for upgrade.py mandatory Signed-off-by: Sebastian Wagner (cherry picked from commit 3f9bf2b3f35566ec5537fd36a5163a17ab7778c6) --- diff --git a/src/mypy.ini b/src/mypy.ini index e74604e732c..12534cf1c39 100755 --- a/src/mypy.ini +++ b/src/mypy.ini @@ -9,3 +9,6 @@ show_error_context = True disallow_untyped_defs = True +[mypy-cephadm.upgrade.*] +disallow_untyped_defs = True + diff --git a/src/pybind/mgr/cephadm/upgrade.py b/src/pybind/mgr/cephadm/upgrade.py index c7b26d59280..45c352b503a 100644 --- a/src/pybind/mgr/cephadm/upgrade.py +++ b/src/pybind/mgr/cephadm/upgrade.py @@ -49,7 +49,7 @@ class UpgradeState: } @classmethod - def from_json(cls, data) -> Optional['UpgradeState']: + def from_json(cls, data: dict) -> Optional['UpgradeState']: if data: return cls(**data) else: @@ -93,7 +93,7 @@ class CephadmUpgrade: r.message = 'Upgrade paused' return r - def upgrade_start(self, image, version) -> str: + def upgrade_start(self, image: str, version: str) -> str: if self.mgr.mode != 'root': raise OrchestratorError('upgrade is not supported in %s mode' % ( self.mgr.mode)) @@ -210,7 +210,7 @@ class CephadmUpgrade: self.mgr.health_checks[alert_id] = alert self.mgr.set_health_checks(self.mgr.health_checks) - def _update_upgrade_progress(self, progress) -> None: + def _update_upgrade_progress(self, progress: float) -> None: if not self.upgrade_state: assert False, 'No upgrade in progress'