From: Sebastian Wagner Date: Mon, 20 Jul 2020 14:39:24 +0000 (+0200) Subject: Merge pull request #35961 from p-se/cephadm-custom-image-fix X-Git-Tag: v16.1.0~1671 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=987121a0798d89a87fb77ba2813ccae8a7b061a3;p=ceph.git Merge pull request #35961 from p-se/cephadm-custom-image-fix cephadm: fix usage of custom Prometheus image Reviewed-by: Sebastian Wagner --- 987121a0798d89a87fb77ba2813ccae8a7b061a3 diff --cc src/cephadm/cephadm index 42819fc783ab,a677a21653b4..a4df9df176c9 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@@ -1273,21 -1239,19 +1273,21 @@@ def make_data_dir_base(fsid, uid, gid) DATA_DIR_MODE) return data_dir_base + def make_data_dir(fsid, daemon_type, daemon_id, uid=None, gid=None): - # type: (str, str, Union[int, str], int, int) -> str - if not uid or not gid: - (uid, gid) = extract_uid_gid() + # type: (str, str, Union[int, str], Optional[int], Optional[int]) -> str + if uid is None or gid is None: + uid, gid = extract_uid_gid() make_data_dir_base(fsid, uid, gid) data_dir = get_data_dir(fsid, daemon_type, daemon_id) makedirs(data_dir, uid, gid, DATA_DIR_MODE) return data_dir + def make_log_dir(fsid, uid=None, gid=None): - # type: (str, int, int) -> str - if not uid or not gid: - (uid, gid) = extract_uid_gid() + # type: (str, Optional[int], Optional[int]) -> str + if uid is None or gid is None: + uid, gid = extract_uid_gid() log_dir = get_log_dir(fsid) makedirs(log_dir, uid, gid, LOG_DIR_MODE) return log_dir @@@ -1805,11 -1752,9 +1805,9 @@@ def get_container(fsid, daemon_type, da entrypoint = '' name = '' - ceph_args = [] # type: List[str] + ceph_args = [] # type: List[str] if daemon_type in Monitoring.components: uid, gid = extract_uid_gid_monitoring(daemon_type) - m = Monitoring.components[daemon_type] # type: ignore - metadata = m.get('image', dict()) # type: ignore monitoring_args = [ '--user', str(uid),