Fix validation error for ImagePullPolicy in charms
[osm/devops.git] / installers / charm / nbi / src / charm.py
index 938a75a..1460459 100755 (executable)
@@ -61,7 +61,7 @@ class ConfigModel(ModelValidator):
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
     mongodb_uri: Optional[str]
-    image_pull_policy: Optional[str]
+    image_pull_policy: str
 
     @validator("auth_backend")
     def validate_auth_backend(cls, v):
@@ -116,7 +116,13 @@ class ConfigModel(ModelValidator):
 
 class NbiCharm(CharmedOsmBase):
     def __init__(self, *args) -> NoReturn:
-        super().__init__(*args, oci_image="image")
+        super().__init__(
+            *args,
+            oci_image="image",
+            debug_mode_config_key="debug_mode",
+            debug_pubkey_config_key="debug_pubkey",
+            vscode_workspace=VSCODE_WORKSPACE,
+        )
 
         self.kafka_client = KafkaClient(self, "kafka")
         self.framework.observe(self.on["kafka"].relation_changed, self.configure_pod)
@@ -296,5 +302,27 @@ class NbiCharm(CharmedOsmBase):
         return pod_spec_builder.build()
 
 
+VSCODE_WORKSPACE = {
+    "folders": [
+        {"path": "/usr/lib/python3/dist-packages/osm_nbi"},
+        {"path": "/usr/lib/python3/dist-packages/osm_common"},
+        {"path": "/usr/lib/python3/dist-packages/osm_im"},
+    ],
+    "settings": {},
+    "launch": {
+        "version": "0.2.0",
+        "configurations": [
+            {
+                "name": "NBI",
+                "type": "python",
+                "request": "launch",
+                "module": "osm_nbi.nbi",
+                "justMyCode": False,
+            }
+        ],
+    },
+}
+
+
 if __name__ == "__main__":
     main(NbiCharm)