Add charmcraft.yaml debug_mode to charmed-osm
[osm/devops.git] / installers / charm / nbi / src / charm.py
index 938a75a..0e36073 100755 (executable)
@@ -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)