From 2118a01c3e36b0209fdc8bc2256109bb41087b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Wed, 9 Oct 2019 10:16:36 +0200 Subject: [PATCH] slaprunner: ~/bin/slapos: don't override SLAPOS_CONFIGURATION Because this slapos often is executed when just running `slapos` at is in the $PATH, we should also consider special cases where users want to call this script with another $SLAPOS_CONFIGURATION. When $SLAPOS_CONFIGURATION is already set, ~/bin/slapos will not change it, it will only set it when not set. --- software/slaprunner/buildout.hash.cfg | 2 +- software/slaprunner/template/slapos-slapuser-script.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/software/slaprunner/buildout.hash.cfg b/software/slaprunner/buildout.hash.cfg index 8ee5c9459..14f49ee42 100644 --- a/software/slaprunner/buildout.hash.cfg +++ b/software/slaprunner/buildout.hash.cfg @@ -78,4 +78,4 @@ md5sum = 2451072826a9ad9425d62c9e9c7f6284 [template-slapuser-script] filename = template/slapos-slapuser-script.in -md5sum = becafae59ab9973724e0edb238f4cb7a +md5sum = 2e5fdd6e8e07429f83a38b148b2f1cb0 diff --git a/software/slaprunner/template/slapos-slapuser-script.in b/software/slaprunner/template/slapos-slapuser-script.in index 5d8459c17..2f48bf155 100644 --- a/software/slaprunner/template/slapos-slapuser-script.in +++ b/software/slaprunner/template/slapos-slapuser-script.in @@ -1,6 +1,6 @@ #!/bin/sh # run slapos command inside slaprunner with appropriate config -SLAPOS_CONFIGURATION={{ config_location }} \ -SLAPOS_CLIENT_CONFIGURATION=$SLAPOS_CONFIGURATION \ +export SLAPOS_CONFIGURATION=${SLAPOS_CONFIGURATION-"{{ config_location }}"} +export SLAPOS_CLIENT_CONFIGURATION=${SLAPOS_CLIENT_CONFIGURATION-$SLAPOS_CONFIGURATION} exec {{ slapos_python_file_location }} "$@" -- 2.30.9