]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: always pass ctx to customize_container_{binds,mounts}
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 4 Nov 2023 20:59:33 +0000 (16:59 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 9 Nov 2023 19:50:46 +0000 (14:50 -0500)
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 <jmulligan@redhat.com>
src/cephadm/cephadmlib/container_daemon_form.py

index 5aef951f37c704d8260bc10beb8cc5f68530703d..4da0624698bcc52b362ffcc347546b221eb1b46d 100644 (file)
@@ -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.
         """