From: John Mulligan Date: Sat, 4 Nov 2023 20:59:33 +0000 (-0400) Subject: cephadm: always pass ctx to customize_container_{binds,mounts} X-Git-Tag: v19.0.0~110^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5c96c510db6b0abd4ec0f4b8325dd1732e9b4ce2;p=ceph-ci.git cephadm: always pass ctx to customize_container_{binds,mounts} These functions often derive the binds and/or mounts from the context variable. Thus we should have the base class method accept the context. Not all subclassess will use it but it will be there for those that do. Also, fix the type for customize_container_mounts - it should be a dict not a list. Signed-off-by: John Mulligan --- diff --git a/src/cephadm/cephadmlib/container_daemon_form.py b/src/cephadm/cephadmlib/container_daemon_form.py index 5aef951f37c..4da0624698b 100644 --- a/src/cephadm/cephadmlib/container_daemon_form.py +++ b/src/cephadm/cephadmlib/container_daemon_form.py @@ -2,7 +2,7 @@ import abc -from typing import List, Tuple, Optional +from typing import List, Tuple, Optional, Dict from .container_types import CephContainer, InitContainer from .context import CephadmContext @@ -39,13 +39,17 @@ class ContainerDaemonForm(DaemonForm): """ return [] - def customize_container_binds(self, binds: List[List[str]]) -> None: + def customize_container_binds( + self, ctx: CephadmContext, binds: List[List[str]] + ) -> None: """Given a list of container binds this function can update, delete, or otherwise mutate the binds that the container will use. """ pass - def customize_container_mounts(self, mounts: List[str]) -> None: + def customize_container_mounts( + self, ctx: CephadmContext, mounts: Dict[str, str] + ) -> None: """Given a list of container mounts this function can update, delete, or otherwise mutate the mounts that the container will use. """