在WAS wsadmin中的AdminApp.update()函数中使用变量

问题描述 投票:0回答:1

我无法在AdminApp.update()函数中使用包含sys.argv[0](EAR文件名)值的字符串变量

我已尝试使用%s然后在最后添加%(APP_NAME)但它不起作用。

我想在这里使用变量:

/installableApps/VARIABLE_I_PASS_FROM_COMMAND

这是命令:

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/wsadmin.sh -lang jython -username wasadmin -password ********** -f /root/subidasPRE/Sample/subidaBatchSample.py Sample-Batch.ear

以下是代码:

import sys
APP_NAME  =  sys.argv[0]
AdminApp.update('SampleEAR', 'app', '[ -operation update -contents /installableApps/%s -nopreCompileJSPs -installed.ear.destination $(APP_INSTALL_ROOT)/myCellCell01 -distributeApp -nouseMetaDataFromBinary -nodeployejb -nocreateMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -noprocessEmbeddedConfig -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -noenableClientModule -clientMode isolated -novalidateSchema -MapModulesToServers [[ SampleEAREJB SampleEAREJB.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_PER SampleEAREJB_PER.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_SIN SampleEAREJB_SIN.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_PRO SampleEAREJB_PRO.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_COM SampleEAREJB_COM.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_CTR SampleEAREJB_CTR.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_TGEN SampleEAREJB_TGEN.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_DOC SampleEAREJB_DOC.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_CTB SampleEAREJB_CTB.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_RIE SampleEAREJB_RIE.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_REC SampleEAREJB_REC.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_TAR SampleEAREJB_TAR.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_AGE SampleEAREJB_AGE.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_PLN SampleEAREJB_PLN.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ ArqEjbGOperaciones.jar ArqEjbGOperaciones.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEAREJB_GCO SampleEAREJB_GCO.jar,META-INF/ejb-jar.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEARWeb SampleEARWeb.war,WEB-INF/web.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ ArqBatchS ArqBatchSWeb.war,WEB-INF/web.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ][ SampleEARWebInterno SampleEARWebInterno.war,WEB-INF/web.xml WebSphere:cell=myCellCell01,cluster=BatchSampleEAR+WebSphere:cell=myCellCell01,node=centurionNode01,server=webpreint443 ]] -MapWebModToVH [[ SampleEARWebInterno SampleEARWebInterno.war,WEB-INF/web.xml SampleEAR_private_host ]] -MapSharedLibForMod [[ BatchSampleEAR META-INF/application.xml LibAxis14+SampleEARlib ]]] % (APP_NAME)' )
AdminConfig.save()

谢谢。

websphere jython wsadmin was
1个回答
0
投票

所以我终于找到了方法。

这有效:

/installableApps/'+APP_NAME+'

希望这有助于某人。

© www.soinside.com 2019 - 2024. All rights reserved.