X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Fcharm%2Fosm-temporal%2Flib%2Fcharms%2Fosm_libs%2Fv0%2Futils.py;h=efc6d748d87d17438594f9cee93a24934c034722;hb=refs%2Fchanges%2F86%2F13286%2F3;hp=df3da94e8ec3083a273ee76b69ea8e873b8db30a;hpb=b26337f4b399b8d2307002aa7ca98c23e2d3a1ed;p=osm%2Fdevops.git diff --git a/installers/charm/osm-temporal/lib/charms/osm_libs/v0/utils.py b/installers/charm/osm-temporal/lib/charms/osm_libs/v0/utils.py index df3da94e..efc6d748 100644 --- a/installers/charm/osm-temporal/lib/charms/osm_libs/v0/utils.py +++ b/installers/charm/osm-temporal/lib/charms/osm_libs/v0/utils.py @@ -235,12 +235,14 @@ wait @dataclass class SubModule: """Represent RO Submodules.""" + sub_module_path: str container_path: str class HostPath: """Represents a hostpath.""" + def __init__(self, config: str, container_path: str, submodules: dict = None) -> None: mount_path_items = config.split("-") mount_path_items.reverse() @@ -257,6 +259,7 @@ class HostPath: self.container_path = container_path self.module_name = container_path.split("/")[-1] + class DebugMode(Object): """Class to handle the debug-mode.""" @@ -432,7 +435,9 @@ class DebugMode(Object): logger.debug(f"adding symlink for {hostpath.config}") if len(hostpath.sub_module_dict) > 0: for sub_module in hostpath.sub_module_dict.keys(): - self.container.exec(["rm", "-rf", hostpath.sub_module_dict[sub_module].container_path]).wait_output() + self.container.exec( + ["rm", "-rf", hostpath.sub_module_dict[sub_module].container_path] + ).wait_output() self.container.exec( [ "ln", @@ -506,7 +511,6 @@ class DebugMode(Object): def _delete_hostpath_from_statefulset(self, hostpath: HostPath, statefulset: StatefulSet): hostpath_unmounted = False for volume in statefulset.spec.template.spec.volumes: - if hostpath.config != volume.name: continue