In the end, a colleague and I de-compiled the com.ibm.websphere.product.VersionInfo class to find a solution which was to simply call the main method from that class two arguments.
- An array of Strings (as you'd expect) containing one element which is the String argument you'd normally use with versionInfo.sh (in my case -maintenancePackages)
- A boolean false (or zero) to prevent the program from exiting (because this for some reason causes your wsadmin shelll to exit)
from java.io import File, PrintStream
import com.ibm.websphere.product.VersionInfo as vInfo
# Keep the existing Syste.out to one side
oldOut = System.out
# Set up a File and associated PrintStream
file = File("/tmp/vinfo.out")
ps = PrintStream(file)
# Point System.out at the PrintStream
System.setOut(ps)
# Call the main method from com.ibm.websphere.product.VersionInfo
# (NOTE: the second arg is a boolean to tell the program not to exit)
vInfo.main(['-maintenancePackages'],0)
# Reset Sysout.out back to STDOUT
System.setOut(oldOut)
/tmp/vinfo.out nor contains your detailed versionInfo -maintenancePackages output
No comments:
Post a Comment