Используйте переменную в функции AdminApp.update () в WAS wsadmin - PullRequest
0 голосов
/ 04 марта 2019

Я не могу использовать строковую переменную внутри функции 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()

Спасибо.

1 Ответ

0 голосов
/ 04 марта 2019

Итак, я наконец нашел способ.

Это работает:

/installableApps/'+APP_NAME+'

Надеюсь, это кому-нибудь поможет.

...