X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Fcharm%2Fosm-lcm%2Flib%2Fcharms%2Fosm_libs%2Fv0%2Futils.py;fp=installers%2Fcharm%2Fosm-lcm%2Flib%2Fcharms%2Fosm_libs%2Fv0%2Futils.py;h=02d46dbc98812e2c623543975ef34a0073d3079d;hb=e93311d0d1e614b2ee73cc88d8a04fdec217cff8;hp=d739ba6880ff3461ddf0cb0fb0fa4ec92777b93d;hpb=b26337f4b399b8d2307002aa7ca98c23e2d3a1ed;p=osm%2Fdevops.git diff --git a/installers/charm/osm-lcm/lib/charms/osm_libs/v0/utils.py b/installers/charm/osm-lcm/lib/charms/osm_libs/v0/utils.py index d739ba68..02d46dbc 100644 --- a/installers/charm/osm-lcm/lib/charms/osm_libs/v0/utils.py +++ b/installers/charm/osm-lcm/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() @@ -250,13 +252,18 @@ class HostPath: if submodules: for submodule in submodules.keys(): self.sub_module_dict[submodule] = SubModule( - sub_module_path=self.mount_path + "/" + submodule + "/" + submodules[submodule].split("/")[-1], + sub_module_path=self.mount_path + + "/" + + submodule + + "/" + + submodules[submodule].split("/")[-1], container_path=submodules[submodule], ) else: self.container_path = container_path self.module_name = container_path.split("/")[-1] + class DebugMode(Object): """Class to handle the debug-mode.""" @@ -432,7 +439,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 +515,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