I have a python file `peekaboo.py` which on standalone exec outputs a json as below.

python FILE OUTPUT(JSON):

```
{"fernet_key": "some fernet_key", "db_url": "some_db_url", "pki_password": "some_pki_password"}

```

however when the jekins is trying to run the same python file, it fails as below.

by the way this python file is suppose to set values for pki\_client\_cacert\_password, db\_url, fernet\_key which will be passed to ansible playbook

```
pipeline {
    parameters {
    string(defaultValue: '', description: '', name: 'pki_client_cacert_password', trim: true)
    string(defaultValue: '', description: '', name: 'db_url', trim: true)
    }
    stages {
    stage('DeployToDev') {
            steps {
                env.artifacts = sh "/var/lib/jenkins/python_jobs/peekaboo_venv/bin/python3 /var/lib/jenkins/python_jobs/peekaboo.py --db_url=${env.db_url} --pki_password=${env.pki_client_cacert_password}"
                echo "${env.artifacts}" 
                ansiblePlaybook credentialsId: "${env.git_credential_id}", disableHostKeyChecking: true, extras: "-e \"pki_client_cacert_password=${env.pki_client_cacert_password} db_url=${env.db_url} fernet_key=${env.fernet_key} use_isrg_freetds=false\"",
            }
        }
    }
}

```

we get following Error

ERROR:

```
WorkflowScript: 32: Expected a step @ line 32, column 21.
                       env.artifacts = sh "/var/lib/jenkins/python_jobs/peekaboo_venv/bin/python3 /var/lib/jenkins/python_jobs/peekaboo.py --db_url=${env.db_url} --pki_password=${env.pki_client_cacert_password}"

```

my question is,

1. how to fix this error
2. how to access the generated values to pass to ansible jobs.