From: Guillermo Calvino Date: Thu, 18 Aug 2022 09:48:30 +0000 (+0200) Subject: Fix bug 2142: Debug mode in Pebble Charms is not working X-Git-Tag: release-v13.0-start~47 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F65%2F12465%2F1;p=osm%2Fdevops.git Fix bug 2142: Debug mode in Pebble Charms is not working Change-Id: Icca7e2b3a38b0c9ca4859138931e2c92566fd1d9 Signed-off-by: Guillermo Calvino --- diff --git a/installers/charm/osm-lcm/src/charm.py b/installers/charm/osm-lcm/src/charm.py index 8c8c6e14..4a362a6a 100755 --- a/installers/charm/osm-lcm/src/charm.py +++ b/installers/charm/osm-lcm/src/charm.py @@ -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() diff --git a/installers/charm/osm-mon/src/charm.py b/installers/charm/osm-mon/src/charm.py index 00444f8a..d926776b 100755 --- a/installers/charm/osm-mon/src/charm.py +++ b/installers/charm/osm-mon/src/charm.py @@ -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: diff --git a/installers/charm/osm-nbi/files/vscode-workspace.json b/installers/charm/osm-nbi/files/vscode-workspace.json index 4f924559..f2baa1d1 100644 --- a/installers/charm/osm-nbi/files/vscode-workspace.json +++ b/installers/charm/osm-nbi/files/vscode-workspace.json @@ -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, } ] } diff --git a/installers/charm/osm-nbi/src/charm.py b/installers/charm/osm-nbi/src/charm.py index 454b1555..23ab0542 100755 --- a/installers/charm/osm-nbi/src/charm.py +++ b/installers/charm/osm-nbi/src/charm.py @@ -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 diff --git a/installers/charm/osm-pol/src/charm.py b/installers/charm/osm-pol/src/charm.py index 1c66157a..2749ddb2 100755 --- a/installers/charm/osm-pol/src/charm.py +++ b/installers/charm/osm-pol/src/charm.py @@ -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: diff --git a/installers/charm/osm-ro/src/charm.py b/installers/charm/osm-ro/src/charm.py index c19281e7..7b8acea7 100755 --- a/installers/charm/osm-ro/src/charm.py +++ b/installers/charm/osm-ro/src/charm.py @@ -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