[Fuego] [PATCH 03/29] shell: modifications for the python parser to see some env variables

Bird, Timothy Tim.Bird at sony.com
Mon Jul 24 23:54:55 UTC 2017



> -----Original Message-----
> From Daniel Sangorrin on Friday, July 21, 2017 1:02 AM
>
> For some reason that is probably explained in the bash
> documentation but I don't understand the return value and
> platform environment variables are not available from the
> parser (common.py: os.environ[xxx]). This modifications made
> it work, but if somebody knows why it behaves like this and
> is able to provide a fix, I'll be happy to use it.

These are shell variables unless they are exported.  Then they become
environment variables.  I suspect we just the changes I show below.
I'll test and let you know.

> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  engine/scripts/common.sh    | 2 +-
>  engine/scripts/functions.sh | 2 --
>  engine/scripts/main.sh      | 4 ++--
>  3 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/engine/scripts/common.sh b/engine/scripts/common.sh
> index 961dbe9..150655e 100644
> --- a/engine/scripts/common.sh
> +++ b/engine/scripts/common.sh
> @@ -27,7 +27,7 @@ function run_python() {
>      if [ ! -z $ORIG_PATH ]
>      then
>          echo "running python with PATH=$ORIG_PATH"
> -        PATH=$ORIG_PATH python "$@"
export PLATFORM

> +        PATH=$ORIG_PATH PLATFORM=$PLATFORM
> RETURN_VALUE=$RETURN_VALUE python "$@"

>      else
>          python "$@"
>      fi
> diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
> index 8a6194a..ddb628f 100755
> --- a/engine/scripts/functions.sh
> +++ b/engine/scripts/functions.sh
> @@ -361,8 +361,6 @@ function fetch_results {
>  }
> 
>  function processing {
> -    local RETURN_VALUE=0
> -
>      # process the fetched data
>      call_if_present test_processing
>      if [ $? -ne 0 ]; then
> diff --git a/engine/scripts/main.sh b/engine/scripts/main.sh
> index a09bb20..4d49c48 100644
> --- a/engine/scripts/main.sh
> +++ b/engine/scripts/main.sh
> @@ -47,8 +47,8 @@ echo "##### doing fuego phase: post_test ########"
>  post_test
> 
>  echo "##### doing fuego phase: processing ########"
> +RETURN_VALUE=0
export RETURN_VALUE=0
>  processing
> -FUEGO_RESULT=$?
> 
>  echo "Fuego: all test phases complete!"
> -exit $FUEGO_RESULT
> +exit $RETURN_VALUE
> --
> 2.7.4
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego


More information about the Fuego mailing list