]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #35961 from p-se/cephadm-custom-image-fix
authorSebastian Wagner <sebastian.wagner@suse.com>
Mon, 20 Jul 2020 14:39:24 +0000 (16:39 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2020 14:39:24 +0000 (16:39 +0200)
cephadm: fix usage of custom Prometheus image

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
1  2 
src/cephadm/cephadm

index 42819fc783aba3a52c061e4e40411a6c5689ce19,a677a21653b4cf08dd7bdb2147679219e3a09b1c..a4df9df176c9d9f874bb5122517eae5254420ad3
@@@ -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),