From: Kristoffer Grönlund Date: Fri, 21 Feb 2020 22:10:09 +0000 (+0100) Subject: cephadm: Fix type errors found by mypy X-Git-Tag: v15.1.1~301^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f2bc613bd27952cdea7ab61fbf77272ab2ce13b;p=ceph.git cephadm: Fix type errors found by mypy Signed-off-by: Kristoffer Grönlund --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 75df61b57f7f..152fda85a6f1 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -52,7 +52,7 @@ import tempfile import time import errno try: - from typing import Dict, List, Tuple, Optional, Union, Any + from typing import Dict, List, Tuple, Optional, Union, Any, NoReturn except ImportError: pass import uuid @@ -521,6 +521,7 @@ def call_timeout(command, timeout): % (timeout, ' '.join(command))) def raise_timeout(command, timeout): + # type: (List[str], int) -> NoReturn msg = 'Command \'%s\' timed out after %s seconds' % (command, timeout) logger.debug(msg) raise TimeoutExpired(msg) @@ -555,13 +556,12 @@ def call_timeout(command, timeout): ################################## def is_available(what, func): - # type: (str, func, Optional[int]) -> func + # type: (str, Any) -> Any """ Wait for a service to become available :param what: the name of the service :param func: the callable object that determines availability - :param retry: max number of retry invocations of func """ retry = args.retry @wraps(func) @@ -2301,7 +2301,7 @@ def list_daemons(detail=True, legacy_dir=None): i['host_version'] = host_version ls.append(i) elif is_fsid(i): - fsid = i + fsid = str(i) # convince mypy that fsid is a str here for j in os.listdir(os.path.join(data_dir, i)): if '.' in j: name = j