diff options
Diffstat (limited to 'src/cephadm/cephadmlib/daemons/ingress.py')
-rw-r--r-- | src/cephadm/cephadmlib/daemons/ingress.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/cephadm/cephadmlib/daemons/ingress.py b/src/cephadm/cephadmlib/daemons/ingress.py index 6064cf538fb..645654b59c8 100644 --- a/src/cephadm/cephadmlib/daemons/ingress.py +++ b/src/cephadm/cephadmlib/daemons/ingress.py @@ -2,9 +2,8 @@ import os from typing import Dict, List, Optional, Tuple, Union +from ceph.cephadm.images import DefaultImages from ..constants import ( - DEFAULT_HAPROXY_IMAGE, - DEFAULT_KEEPALIVED_IMAGE, DATA_DIR_MODE, ) from ..container_daemon_form import ContainerDaemonForm, daemon_to_container @@ -25,7 +24,7 @@ class HAproxy(ContainerDaemonForm): daemon_type = 'haproxy' required_files = ['haproxy.cfg'] - default_image = DEFAULT_HAPROXY_IMAGE + default_image = DefaultImages.HAPROXY.image_ref @classmethod def for_daemon_type(cls, daemon_type: str) -> bool: @@ -80,8 +79,7 @@ class HAproxy(ContainerDaemonForm): def get_daemon_args(self) -> List[str]: return ['haproxy', '-f', '/var/lib/haproxy/haproxy.cfg'] - def validate(self): - # type: () -> None + def validate(self) -> None: if not is_fsid(self.fsid): raise Error('not an fsid: %s' % self.fsid) if not self.daemon_id: @@ -97,12 +95,10 @@ class HAproxy(ContainerDaemonForm): 'required file missing from config-json: %s' % fname ) - def get_daemon_name(self): - # type: () -> str + def get_daemon_name(self) -> str: return '%s.%s' % (self.daemon_type, self.daemon_id) - def get_container_name(self, desc=None): - # type: (Optional[str]) -> str + def get_container_name(self, desc: Optional[str] = None) -> str: cname = 'ceph-%s-%s' % (self.fsid, self.get_daemon_name()) if desc: cname = '%s-%s' % (cname, desc) @@ -156,7 +152,7 @@ class Keepalived(ContainerDaemonForm): daemon_type = 'keepalived' required_files = ['keepalived.conf'] - default_image = DEFAULT_KEEPALIVED_IMAGE + default_image = DefaultImages.KEEPALIVED.image_ref @classmethod def for_daemon_type(cls, daemon_type: str) -> bool: @@ -210,8 +206,7 @@ class Keepalived(ContainerDaemonForm): # populate files from the config-json populate_files(data_dir, self.files, uid, gid) - def validate(self): - # type: () -> None + def validate(self) -> None: if not is_fsid(self.fsid): raise Error('not an fsid: %s' % self.fsid) if not self.daemon_id: @@ -227,20 +222,17 @@ class Keepalived(ContainerDaemonForm): 'required file missing from config-json: %s' % fname ) - def get_daemon_name(self): - # type: () -> str + def get_daemon_name(self) -> str: return '%s.%s' % (self.daemon_type, self.daemon_id) - def get_container_name(self, desc=None): - # type: (Optional[str]) -> str + def get_container_name(self, desc: Optional[str] = None) -> str: cname = 'ceph-%s-%s' % (self.fsid, self.get_daemon_name()) if desc: cname = '%s-%s' % (cname, desc) return cname @staticmethod - def get_container_envs(): - # type: () -> List[str] + def get_container_envs() -> List[str]: envs = [ 'KEEPALIVED_AUTOCONF=false', 'KEEPALIVED_CONF=/etc/keepalived/keepalived.conf', |