I'm trying to access the Admin objects via a Jython script in order to update a Maven app deployed to a WebSphere Application Server without having to march through the Integrated Solutions Console every time I make a change. My question is simple: I know how to invoke the commands once I access the Admin objects, but I'm having difficulty getting that far. Once I'm in the bin folder of my server profile, do I need to assign them to objects, or can I just call them directly? And how, specifically, would I do that? Here's the code I have now:
#!usr/bin/local/python
import sys
import os
try:
serverPath = 'c:\IBM\WebSphere8\AppServerND\profiles\\WAS8\\bin\\'
os.chdir(serverPath)
print AdminApp.listModules('restreportscore-application')
except:
e = sys.exc_info()[0]
print( "Error: %s" % e )
endSelect = raw_input("Press Enter to continue...")
But it's throwing an error of type 'exceptions.NameError.'