Changing NBI Pebble Service command to enter the startup directory first
[osm/devops.git] / installers / charm / osm-nbi / src / charm.py
index 00ef425..4a0bbf1 100755 (executable)
@@ -267,10 +267,11 @@ class OsmNbiCharm(CharmBase):
                 "nbi": {
                     "override": "replace",
                     "summary": "nbi service",
-                    "command": "python3 -m osm_nbi.nbi",
+                    "command": "/bin/sh -c 'cd /app/osm_nbi && python3 -m osm_nbi.nbi'",  # cd /app/osm_nbi is needed until we upgrade Juju to 3.x
                     "startup": "enabled",
                     "user": "appuser",
                     "group": "appuser",
+                    "working-dir": "/app/osm_nbi",  # This parameter has no effect in juju 2.9.x
                     "environment": {
                         # General configuration
                         "OSMNBI_SERVER_ENABLE_TEST": False,