prreddy
asked on
Websphere Jython script
Hi,
i am working on Websphere and do most of the configuration settings and deployments using adminconsole. I would like to execute wsadmin commands using jython scripting...I created jython file and try to execute but i coudn't succeed...I am getting this exception...Appreciate if anyone help on this...
thanks,
-raj
i am working on Websphere and do most of the configuration settings and deployments using adminconsole. I would like to execute wsadmin commands using jython scripting...I created jython file and try to execute but i coudn't succeed...I am getting this exception...Appreciate if anyone help on this...
thanks,
-raj
import sys
#def list1(location, nodeName, serverName):
# seting globals
#--------------------------------------
global AdminApp
global AdminControl
global AdminConfig
global Help
# checking
#--------------------------------------------------------------
cellName = AdminControl.getCell()
node = AdminConfig.getid("/Node:" + nodeName + "/")
print "checking for existence of node " + nodeName
if len(node) == 0:
print "Error -- node not found for name " + nodeName
return
# list the existing applications
#---------------------------------------------------------
apps = AdminApp.list()
print "Installed applications: "
print apps
------------------------------------------
Exception:
------------------------------------------
WASX7015E: Exception running command: "execfile("list1.py")"; exception information:
com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<input>", line 1, in ?
File "list1.py", line 36
global AdminApp
^
SyntaxError: invalid syntax
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Whitespace is significant is Jython and the parent language Python.
Thanks for the grade & points.
Good luck & have a great day
Thanks for the grade & points.
Good luck & have a great day
ASKER