简体   繁体   中英

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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM