Fixing hostpaths of RO side car charm, updating osm_lib library. 81/12481/5
authoraticig <gulsum.atici@canonical.com>
Tue, 23 Aug 2022 22:27:39 +0000 (01:27 +0300)
committeraticig <gulsum.atici@canonical.com>
Thu, 1 Sep 2022 20:41:41 +0000 (23:41 +0300)
Updating osm_libs charm library and update the new version of
library in osm sidecar charms.

Change-Id: If3e526af823d0862e45513bd77dfdae1ef3e2398
Signed-off-by: aticig <gulsum.atici@canonical.com>
17 files changed:
installers/charm/juju-simplestreams-operator/charmcraft.yaml
installers/charm/juju-simplestreams-operator/lib/charms/osm_libs/v0/utils.py
installers/charm/osm-lcm/charmcraft.yaml
installers/charm/osm-lcm/lib/charms/osm_libs/v0/utils.py
installers/charm/osm-mon/charmcraft.yaml
installers/charm/osm-mon/lib/charms/osm_libs/v0/utils.py
installers/charm/osm-nbi/charmcraft.yaml
installers/charm/osm-nbi/lib/charms/osm_libs/v0/utils.py
installers/charm/osm-ng-ui/charmcraft.yaml
installers/charm/osm-ng-ui/lib/charms/osm_libs/v0/utils.py
installers/charm/osm-pol/charmcraft.yaml
installers/charm/osm-pol/lib/charms/osm_libs/v0/utils.py
installers/charm/osm-ro/charmcraft.yaml
installers/charm/osm-ro/lib/charms/osm_libs/v0/utils.py
installers/charm/osm-ro/src/charm.py
installers/charm/osm-ro/tox.ini
installers/charm/vca-integrator-operator/charmcraft.yaml

index eaab6bb..05960ce 100644 (file)
@@ -30,5 +30,5 @@ bases:
 
 parts:
   charm:
-    prime: 
-      - files/*
\ No newline at end of file
+    prime:
+      - files/*
index b7009c4..df3da94 100644 (file)
@@ -107,6 +107,7 @@ class MyCharm(CharmBase):
 
 - Get pod IP with `get_pod_ip()`
 """
+from dataclasses import dataclass
 import logging
 import secrets
 import socket
@@ -136,7 +137,7 @@ LIBAPI = 0
 
 # Increment this PATCH version before using `charmcraft publish-lib` or reset
 # to 0 if you are raising the major API version
-LIBPATCH = 2
+LIBPATCH = 3
 
 logger = logging.getLogger(__name__)
 
@@ -231,17 +232,30 @@ 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) -> None:
+    def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
         mount_path_items = config.split("-")
         mount_path_items.reverse()
         self.mount_path = "/" + "/".join(mount_path_items)
         self.config = config
-        self.container_path = container_path
-        self.module_name = container_path.split("/")[-1]
-
+        self.sub_module_dict = {}
+        if submodules:
+            for submodule in submodules.keys():
+                self.sub_module_dict[submodule] = SubModule(
+                    sub_module_path=self.mount_path + "/" + submodule,
+                    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."""
@@ -416,15 +430,28 @@ class DebugMode(Object):
         # Add symlinks to mounted hostpaths
         for hostpath in mounted_hostpaths:
             logger.debug(f"adding symlink for {hostpath.config}")
-            self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
-            self.container.exec(
-                [
-                    "ln",
-                    "-s",
-                    f"{hostpath.mount_path}/{hostpath.module_name}",
-                    hostpath.container_path,
-                ]
-            )
+            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(
+                        [
+                            "ln",
+                            "-s",
+                            hostpath.sub_module_dict[sub_module].sub_module_path,
+                            hostpath.sub_module_dict[sub_module].container_path,
+                        ]
+                    )
+
+            else:
+                self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
+                self.container.exec(
+                    [
+                        "ln",
+                        "-s",
+                        f"{hostpath.mount_path}/{hostpath.module_name}",
+                        hostpath.container_path,
+                    ]
+                )
 
     def _configure_hostpaths(self, hostpaths: List[HostPath]):
         client = Client()
index 2932e58..f5e3ff3 100644 (file)
@@ -32,5 +32,5 @@ parts:
   charm:
     # build-packages:
     #   - git
-    prime: 
-      - files/*
\ No newline at end of file
+    prime:
+      - files/*
index e686f82..df3da94 100644 (file)
@@ -107,7 +107,7 @@ class MyCharm(CharmBase):
 
 - Get pod IP with `get_pod_ip()`
 """
-
+from dataclasses import dataclass
 import logging
 import secrets
 import socket
@@ -137,7 +137,7 @@ LIBAPI = 0
 
 # Increment this PATCH version before using `charmcraft publish-lib` or reset
 # to 0 if you are raising the major API version
-LIBPATCH = 2
+LIBPATCH = 3
 
 logger = logging.getLogger(__name__)
 
@@ -232,17 +232,30 @@ 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) -> None:
+    def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
         mount_path_items = config.split("-")
         mount_path_items.reverse()
         self.mount_path = "/" + "/".join(mount_path_items)
         self.config = config
-        self.container_path = container_path
-        self.module_name = container_path.split("/")[-1]
-
+        self.sub_module_dict = {}
+        if submodules:
+            for submodule in submodules.keys():
+                self.sub_module_dict[submodule] = SubModule(
+                    sub_module_path=self.mount_path + "/" + submodule,
+                    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."""
@@ -417,15 +430,28 @@ class DebugMode(Object):
         # Add symlinks to mounted hostpaths
         for hostpath in mounted_hostpaths:
             logger.debug(f"adding symlink for {hostpath.config}")
-            self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
-            self.container.exec(
-                [
-                    "ln",
-                    "-s",
-                    f"{hostpath.mount_path}/{hostpath.module_name}",
-                    hostpath.container_path,
-                ]
-            )
+            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(
+                        [
+                            "ln",
+                            "-s",
+                            hostpath.sub_module_dict[sub_module].sub_module_path,
+                            hostpath.sub_module_dict[sub_module].container_path,
+                        ]
+                    )
+
+            else:
+                self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
+                self.container.exec(
+                    [
+                        "ln",
+                        "-s",
+                        f"{hostpath.mount_path}/{hostpath.module_name}",
+                        hostpath.container_path,
+                    ]
+                )
 
     def _configure_hostpaths(self, hostpaths: List[HostPath]):
         client = Client()
index e13cdaf..f5e3ff3 100644 (file)
@@ -23,14 +23,14 @@ type: charm
 bases:
   - build-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
     run-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
 
 parts:
   charm:
     # build-packages:
     #   - git
     prime:
-      - files/*
\ No newline at end of file
+      - files/*
index b7009c4..df3da94 100644 (file)
@@ -107,6 +107,7 @@ class MyCharm(CharmBase):
 
 - Get pod IP with `get_pod_ip()`
 """
+from dataclasses import dataclass
 import logging
 import secrets
 import socket
@@ -136,7 +137,7 @@ LIBAPI = 0
 
 # Increment this PATCH version before using `charmcraft publish-lib` or reset
 # to 0 if you are raising the major API version
-LIBPATCH = 2
+LIBPATCH = 3
 
 logger = logging.getLogger(__name__)
 
@@ -231,17 +232,30 @@ 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) -> None:
+    def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
         mount_path_items = config.split("-")
         mount_path_items.reverse()
         self.mount_path = "/" + "/".join(mount_path_items)
         self.config = config
-        self.container_path = container_path
-        self.module_name = container_path.split("/")[-1]
-
+        self.sub_module_dict = {}
+        if submodules:
+            for submodule in submodules.keys():
+                self.sub_module_dict[submodule] = SubModule(
+                    sub_module_path=self.mount_path + "/" + submodule,
+                    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."""
@@ -416,15 +430,28 @@ class DebugMode(Object):
         # Add symlinks to mounted hostpaths
         for hostpath in mounted_hostpaths:
             logger.debug(f"adding symlink for {hostpath.config}")
-            self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
-            self.container.exec(
-                [
-                    "ln",
-                    "-s",
-                    f"{hostpath.mount_path}/{hostpath.module_name}",
-                    hostpath.container_path,
-                ]
-            )
+            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(
+                        [
+                            "ln",
+                            "-s",
+                            hostpath.sub_module_dict[sub_module].sub_module_path,
+                            hostpath.sub_module_dict[sub_module].container_path,
+                        ]
+                    )
+
+            else:
+                self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
+                self.container.exec(
+                    [
+                        "ln",
+                        "-s",
+                        f"{hostpath.mount_path}/{hostpath.module_name}",
+                        hostpath.container_path,
+                    ]
+                )
 
     def _configure_hostpaths(self, hostpaths: List[HostPath]):
         client = Client()
index aaef73f..42fb3ec 100644 (file)
@@ -23,14 +23,14 @@ type: charm
 bases:
   - build-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
     run-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
 
 parts:
   charm:
     build-packages:
       - git
-    prime: 
+    prime:
       - files/*
\ No newline at end of file
index b7009c4..df3da94 100644 (file)
@@ -107,6 +107,7 @@ class MyCharm(CharmBase):
 
 - Get pod IP with `get_pod_ip()`
 """
+from dataclasses import dataclass
 import logging
 import secrets
 import socket
@@ -136,7 +137,7 @@ LIBAPI = 0
 
 # Increment this PATCH version before using `charmcraft publish-lib` or reset
 # to 0 if you are raising the major API version
-LIBPATCH = 2
+LIBPATCH = 3
 
 logger = logging.getLogger(__name__)
 
@@ -231,17 +232,30 @@ 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) -> None:
+    def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
         mount_path_items = config.split("-")
         mount_path_items.reverse()
         self.mount_path = "/" + "/".join(mount_path_items)
         self.config = config
-        self.container_path = container_path
-        self.module_name = container_path.split("/")[-1]
-
+        self.sub_module_dict = {}
+        if submodules:
+            for submodule in submodules.keys():
+                self.sub_module_dict[submodule] = SubModule(
+                    sub_module_path=self.mount_path + "/" + submodule,
+                    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."""
@@ -416,15 +430,28 @@ class DebugMode(Object):
         # Add symlinks to mounted hostpaths
         for hostpath in mounted_hostpaths:
             logger.debug(f"adding symlink for {hostpath.config}")
-            self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
-            self.container.exec(
-                [
-                    "ln",
-                    "-s",
-                    f"{hostpath.mount_path}/{hostpath.module_name}",
-                    hostpath.container_path,
-                ]
-            )
+            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(
+                        [
+                            "ln",
+                            "-s",
+                            hostpath.sub_module_dict[sub_module].sub_module_path,
+                            hostpath.sub_module_dict[sub_module].container_path,
+                        ]
+                    )
+
+            else:
+                self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
+                self.container.exec(
+                    [
+                        "ln",
+                        "-s",
+                        f"{hostpath.mount_path}/{hostpath.module_name}",
+                        hostpath.container_path,
+                    ]
+                )
 
     def _configure_hostpaths(self, hostpaths: List[HostPath]):
         client = Client()
index 25ff590..072529c 100644 (file)
@@ -23,10 +23,10 @@ type: charm
 bases:
   - build-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
     run-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
 
 parts:
   charm:
index 3feed7d..df3da94 100644 (file)
@@ -107,6 +107,7 @@ class MyCharm(CharmBase):
 
 - Get pod IP with `get_pod_ip()`
 """
+from dataclasses import dataclass
 import logging
 import secrets
 import socket
@@ -136,7 +137,7 @@ LIBAPI = 0
 
 # Increment this PATCH version before using `charmcraft publish-lib` or reset
 # to 0 if you are raising the major API version
-LIBPATCH = 1
+LIBPATCH = 3
 
 logger = logging.getLogger(__name__)
 
@@ -231,17 +232,30 @@ 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) -> None:
+    def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
         mount_path_items = config.split("-")
         mount_path_items.reverse()
         self.mount_path = "/" + "/".join(mount_path_items)
         self.config = config
-        self.container_path = container_path
-        self.module_name = container_path.split("/")[-1]
-
+        self.sub_module_dict = {}
+        if submodules:
+            for submodule in submodules.keys():
+                self.sub_module_dict[submodule] = SubModule(
+                    sub_module_path=self.mount_path + "/" + submodule,
+                    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."""
@@ -416,15 +430,28 @@ class DebugMode(Object):
         # Add symlinks to mounted hostpaths
         for hostpath in mounted_hostpaths:
             logger.debug(f"adding symlink for {hostpath.config}")
-            self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
-            self.container.exec(
-                [
-                    "ln",
-                    "-s",
-                    f"{hostpath.mount_path}/{hostpath.module_name}",
-                    hostpath.container_path,
-                ]
-            )
+            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(
+                        [
+                            "ln",
+                            "-s",
+                            hostpath.sub_module_dict[sub_module].sub_module_path,
+                            hostpath.sub_module_dict[sub_module].container_path,
+                        ]
+                    )
+
+            else:
+                self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
+                self.container.exec(
+                    [
+                        "ln",
+                        "-s",
+                        f"{hostpath.mount_path}/{hostpath.module_name}",
+                        hostpath.container_path,
+                    ]
+                )
 
     def _configure_hostpaths(self, hostpaths: List[HostPath]):
         client = Client()
@@ -510,7 +537,7 @@ class DebugMode(Object):
         pod_ip: str,
         user: str = "root",
         workspace_path: str = "/debug.code-workspace",
-    ) -> None:
+    ) -> str:
         return f"code --remote ssh-remote+{user}@{pod_ip} {workspace_path}"
 
     def _restart(self):
index 584a826..f5e3ff3 100644 (file)
@@ -32,5 +32,5 @@ parts:
   charm:
     # build-packages:
     #   - git
-    prime: 
+    prime:
       - files/*
index b7009c4..df3da94 100644 (file)
@@ -107,6 +107,7 @@ class MyCharm(CharmBase):
 
 - Get pod IP with `get_pod_ip()`
 """
+from dataclasses import dataclass
 import logging
 import secrets
 import socket
@@ -136,7 +137,7 @@ LIBAPI = 0
 
 # Increment this PATCH version before using `charmcraft publish-lib` or reset
 # to 0 if you are raising the major API version
-LIBPATCH = 2
+LIBPATCH = 3
 
 logger = logging.getLogger(__name__)
 
@@ -231,17 +232,30 @@ 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) -> None:
+    def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
         mount_path_items = config.split("-")
         mount_path_items.reverse()
         self.mount_path = "/" + "/".join(mount_path_items)
         self.config = config
-        self.container_path = container_path
-        self.module_name = container_path.split("/")[-1]
-
+        self.sub_module_dict = {}
+        if submodules:
+            for submodule in submodules.keys():
+                self.sub_module_dict[submodule] = SubModule(
+                    sub_module_path=self.mount_path + "/" + submodule,
+                    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."""
@@ -416,15 +430,28 @@ class DebugMode(Object):
         # Add symlinks to mounted hostpaths
         for hostpath in mounted_hostpaths:
             logger.debug(f"adding symlink for {hostpath.config}")
-            self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
-            self.container.exec(
-                [
-                    "ln",
-                    "-s",
-                    f"{hostpath.mount_path}/{hostpath.module_name}",
-                    hostpath.container_path,
-                ]
-            )
+            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(
+                        [
+                            "ln",
+                            "-s",
+                            hostpath.sub_module_dict[sub_module].sub_module_path,
+                            hostpath.sub_module_dict[sub_module].container_path,
+                        ]
+                    )
+
+            else:
+                self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
+                self.container.exec(
+                    [
+                        "ln",
+                        "-s",
+                        f"{hostpath.mount_path}/{hostpath.module_name}",
+                        hostpath.container_path,
+                    ]
+                )
 
     def _configure_hostpaths(self, hostpaths: List[HostPath]):
         client = Client()
index 2932e58..f5e3ff3 100644 (file)
@@ -32,5 +32,5 @@ parts:
   charm:
     # build-packages:
     #   - git
-    prime: 
-      - files/*
\ No newline at end of file
+    prime:
+      - files/*
index b7009c4..df3da94 100644 (file)
@@ -107,6 +107,7 @@ class MyCharm(CharmBase):
 
 - Get pod IP with `get_pod_ip()`
 """
+from dataclasses import dataclass
 import logging
 import secrets
 import socket
@@ -136,7 +137,7 @@ LIBAPI = 0
 
 # Increment this PATCH version before using `charmcraft publish-lib` or reset
 # to 0 if you are raising the major API version
-LIBPATCH = 2
+LIBPATCH = 3
 
 logger = logging.getLogger(__name__)
 
@@ -231,17 +232,30 @@ 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) -> None:
+    def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
         mount_path_items = config.split("-")
         mount_path_items.reverse()
         self.mount_path = "/" + "/".join(mount_path_items)
         self.config = config
-        self.container_path = container_path
-        self.module_name = container_path.split("/")[-1]
-
+        self.sub_module_dict = {}
+        if submodules:
+            for submodule in submodules.keys():
+                self.sub_module_dict[submodule] = SubModule(
+                    sub_module_path=self.mount_path + "/" + submodule,
+                    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."""
@@ -416,15 +430,28 @@ class DebugMode(Object):
         # Add symlinks to mounted hostpaths
         for hostpath in mounted_hostpaths:
             logger.debug(f"adding symlink for {hostpath.config}")
-            self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
-            self.container.exec(
-                [
-                    "ln",
-                    "-s",
-                    f"{hostpath.mount_path}/{hostpath.module_name}",
-                    hostpath.container_path,
-                ]
-            )
+            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(
+                        [
+                            "ln",
+                            "-s",
+                            hostpath.sub_module_dict[sub_module].sub_module_path,
+                            hostpath.sub_module_dict[sub_module].container_path,
+                        ]
+                    )
+
+            else:
+                self.container.exec(["rm", "-rf", hostpath.container_path]).wait_output()
+                self.container.exec(
+                    [
+                        "ln",
+                        "-s",
+                        f"{hostpath.mount_path}/{hostpath.module_name}",
+                        hostpath.container_path,
+                    ]
+                )
 
     def _configure_hostpaths(self, hostpaths: List[HostPath]):
         client = Client()
index 7b8acea..0c5ab9a 100755 (executable)
@@ -49,10 +49,29 @@ from ops.model import ActiveStatus, Container
 
 from legacy_interfaces import MongoClient
 
+ro_host_paths = {
+    "NG-RO": "/usr/lib/python3/dist-packages/osm_ng_ro",
+    "RO-plugin": "/usr/lib/python3/dist-packages/osm_ro_plugin",
+    "RO-SDN-arista_cloudvision": "/usr/lib/python3/dist-packages/osm_rosdn_arista_cloudvision",
+    "RO-SDN-dpb": "/usr/lib/python3/dist-packages/osm_rosdn_dpb",
+    "RO-SDN-dynpac": "/usr/lib/python3/dist-packages/osm_rosdn_dynpac",
+    "RO-SDN-floodlight_openflow": "/usr/lib/python3/dist-packages/osm_rosdn_floodlightof",
+    "RO-SDN-ietfl2vpn": "/usr/lib/python3/dist-packages/osm_rosdn_ietfl2vpn",
+    "RO-SDN-juniper_contrail": "/usr/lib/python3/dist-packages/osm_rosdn_juniper_contrail",
+    "RO-SDN-odl_openflow": "/usr/lib/python3/dist-packages/osm_rosdn_odlof",
+    "RO-SDN-onos_vpls": "/usr/lib/python3/dist-packages/osm_rosdn_onos_vpls",
+    "RO-VIM-aws": "/usr/lib/python3/dist-packages/osm_rovim_aws",
+    "RO-VIM-azure": "/usr/lib/python3/dist-packages/osm_rovim_azure",
+    "RO-VIM-gcp": "/usr/lib/python3/dist-packages/osm_rovim_gcp",
+    "RO-VIM-openstack": "/usr/lib/python3/dist-packages/osm_rovim_openstack",
+    "RO-VIM-openvim": "/usr/lib/python3/dist-packages/osm_rovim_openvim",
+    "RO-VIM-vmware": "/usr/lib/python3/dist-packages/osm_rovim_vmware",
+}
 HOSTPATHS = [
     HostPath(
         config="ro-hostpath",
-        container_path="/usr/lib/python3/dist-packages/osm_ro",
+        container_path="/usr/lib/python3/dist-packages/",
+        submodules=ro_host_paths,
     ),
     HostPath(
         config="common-hostpath",
index 90adfe2..e27651d 100644 (file)
@@ -62,10 +62,10 @@ deps =
     codespell
 commands =
     # uncomment the following line if this charm owns a lib
-    codespell {[vars]lib_path}
+    codespell {[vars]lib_path} --ignore-words-list=Ro,RO,ro
     codespell {toxinidir}/. --skip {toxinidir}/.git --skip {toxinidir}/.tox \
       --skip {toxinidir}/build --skip {toxinidir}/lib --skip {toxinidir}/venv \
-      --skip {toxinidir}/.mypy_cache --skip {toxinidir}/icon.svg
+      --skip {toxinidir}/.mypy_cache --skip {toxinidir}/icon.svg --ignore-words-list=Ro,RO,ro
     # pflake8 wrapper supports config from pyproject.toml
     pflake8 {[vars]all_path}
     isort --check-only --diff {[vars]all_path}
index 0d7d5eb..98ffe03 100644 (file)
@@ -19,10 +19,10 @@ type: "charm"
 bases:
   - build-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
     run-on:
       - name: "ubuntu"
-        channel: "20.04"
+        channel: "22.04"
 parts:
   charm:
     build-environment: