Search code examples
pythonshellbatch-filewlst

How to return wlst python value to shell


I am launching a wlst python script like this :

cmd file :

call /oracle_common/common/bin/wlst.cmd myWlstScript.py
PAUSE

The python script is checking if a datasource is up :

connect('XXXX','XXXX','t3://XXXX.local:XXXX')
serverRuntime()
dsMBeans = cmo.getJDBCServiceRuntime().getJDBCDataSourceRuntimeMBeans()
#Do stuff to check datasource state

How can i return a value from the wlst python script to the cmd file ? (or shell)


Solution

  • To return a value from the wlst python script to the cmd file in my simple case, i did the following :

    python wlst

    exit(exitcode=3)
    

    cmd

    IF %ERRORLEVEL% EQU 3 echo it worked