0
我想將變量名和值從jython腳本傳遞到批處理文件。另外,我如何在批處理文件中訪問它。如何將變量名和值從jython傳遞到批處理文件
在我的情況下,我想將「bootstrapport」和「defaulthostport」的varname名稱和值傳遞給批處理文件Deploy.bat。
ports.jy
-
servers = AdminConfig.list('ServerEntry').splitlines() for server
in servers : print '\n' print "Server Name : " +
server[0:server.find('(')] print "=" *30 NamedEndPoints =
AdminConfig.list("NamedEndPoint" , server).splitlines()
for namedEndPoint in NamedEndPoints: endPointName =
AdminConfig.showAttribute(namedEndPoint, "endPointName")
if endPointName == "BOOTSTRAP_ADDRESS":
bootstrapendPoint = AdminConfig.showAttribute(namedEndPoint, "endPoint")
host = AdminConfig.showAttribute(bootstrapendPoint, "host")
bootstrapport = AdminConfig.showAttribute(bootstrapendPoint, "port")
print "Endpoint Name : " + endPointName + " Host : " + host + " port : " +
bootstrapport
elif endPointName == "WC_defaulthost":
defaulthostendPoint = AdminConfig.showAttribute(namedEndPoint,"endPoint")
host = AdminConfig.showAttribute(defaulthostendPoint,"host")
defaulthostport =AdminConfig.showAttribute(defaulthostendPoint, "port")
print "Endpoint Name : " + endPointName + " Host : " + host + " port : " +
defaulthostport
========================================================================