From d3fd0b95a493fad347fd7ae8b9e056e4730541f8 Mon Sep 17 00:00:00 2001 From: gatici Date: Wed, 19 Jul 2023 12:45:43 +0300 Subject: [PATCH] Changing NBI Pebble Service command to enter the startup directory first In rockcraft.yaml WORKDIR is not supported, so it needs to be specified in Pebble service definition by using working-dir parameter. However, working-dir is not supported in Juju 2.9.x. So, we are entering to the startup directory first as a workaround. Change-Id: Ia441b5445822f0833f659f964fc1f2216586cdc5 Signed-off-by: gatici --- installers/charm/osm-nbi/config.yaml | 2 -- installers/charm/osm-nbi/src/charm.py | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/installers/charm/osm-nbi/config.yaml b/installers/charm/osm-nbi/config.yaml index 961cfff2..bed55dad 100644 --- a/installers/charm/osm-nbi/config.yaml +++ b/installers/charm/osm-nbi/config.yaml @@ -60,9 +60,7 @@ options: default: 20 description: Max allowed body-size (for file uploads) in megabytes, set to 0 to disable limits. - source: default type: int - value: 20 tls-secret-name: description: TLS secret name to use for ingress. type: string diff --git a/installers/charm/osm-nbi/src/charm.py b/installers/charm/osm-nbi/src/charm.py index 00ef4259..4a0bbf16 100755 --- a/installers/charm/osm-nbi/src/charm.py +++ b/installers/charm/osm-nbi/src/charm.py @@ -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, -- 2.25.1