Fix bug 2142: Debug mode in Pebble Charms is not working 65/12465/1
authorGuillermo Calvino <guillermo.calvino@canonical.com>
Thu, 18 Aug 2022 09:48:30 +0000 (11:48 +0200)
committerGuillermo Calvino <guillermo.calvino@canonical.com>
Thu, 18 Aug 2022 09:48:30 +0000 (11:48 +0200)
Change-Id: Icca7e2b3a38b0c9ca4859138931e2c92566fd1d9
Signed-off-by: Guillermo Calvino <guillermo.calvino@canonical.com>
installers/charm/osm-lcm/src/charm.py
installers/charm/osm-mon/src/charm.py
installers/charm/osm-nbi/files/vscode-workspace.json
installers/charm/osm-nbi/src/charm.py
installers/charm/osm-pol/src/charm.py
installers/charm/osm-ro/src/charm.py

index 8c8c6e1..4a362a6 100755 (executable)
@@ -102,7 +102,8 @@ class OsmLcmCharm(CharmBase):
             # Check if the container is ready.
             # Eventually it will become ready after the first pebble-ready event.
             check_container_ready(self.container)
-            self._configure_service(self.container)
+            if not self.debug_mode.started:
+                self._configure_service(self.container)
 
             # Update charm status
             self._on_update_status()
index 00444f8..d926776 100755 (executable)
@@ -116,8 +116,8 @@ class OsmMonCharm(CharmBase):
             # Check if the container is ready.
             # Eventually it will become ready after the first pebble-ready event.
             check_container_ready(self.container)
-
-            self._configure_service(self.container)
+            if not self.debug_mode.started:
+                self._configure_service(self.container)
             # Update charm status
             self._on_update_status()
         except CharmError as e:
index 4f92455..f2baa1d 100644 (file)
@@ -1,8 +1,14 @@
 {
     "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"},
+        {
+            "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": {
@@ -13,7 +19,7 @@
                 "type": "python",
                 "request": "launch",
                 "module": "osm_nbi.nbi",
-                "justMyCode": False,
+                "justMyCode": false,
             }
         ]
     }
index 454b155..23ab054 100755 (executable)
@@ -113,7 +113,8 @@ class OsmNbiCharm(CharmBase):
             # Eventually it will become ready after the first pebble-ready event.
             check_container_ready(self.container)
 
-            self._configure_service(self.container)
+            if not self.debug_mode.started:
+                self._configure_service(self.container)
             self._update_ingress_config()
             self._update_nbi_relation()
             # Update charm status
index 1c66157..2749ddb 100755 (executable)
@@ -90,7 +90,8 @@ class OsmPolCharm(CharmBase):
             # Eventually it will become ready after the first pebble-ready event.
             check_container_ready(self.container)
 
-            self._configure_service(self.container)
+            if not self.debug_mode.started:
+                self._configure_service(self.container)
             # Update charm status
             self._on_update_status()
         except CharmError as e:
index c19281e..7b8acea 100755 (executable)
@@ -102,7 +102,8 @@ class OsmRoCharm(CharmBase):
             check_container_ready(self.container)
 
             self._configure_certificates()
-            self._configure_service()
+            if not self.debug_mode.started:
+                self._configure_service()
             self._update_ro_relation()
 
             # Update charm status