Posts

Showing posts with the label readlines function

File operations in Jython

Image
File operations are very important for Jython scripting. File Operations in wsadmin scripting Creating a file with list of archives which are present in the installableApp folder. vagrant@ubuntu-was8:~/IBM/WebSphere/AppServer/installableApps$ ls > ~/scripts/applist.txt vagrant@ubuntu-was8:~/IBM/WebSphere/AppServer/installableApps$ cat ~/scripts/applist.txt AjaxProxy.war CacheMonitor.ear DefaultApplication.ear ... WSNServicePoint.ear These kind of need would be in every automation script; It may be list of deployables or Server to be restarted. ############################### # # Script File: fileoper.py # usage : wsadmin -f [path 2="" script=""]/fileoper.py # The file read operation # ############################### import os,sys f=open("/home/vagrant/scripts/applist.txt") for appName in f.readlines(): print appName.split('.')[0] print "End of the file..." wsadmin>execfile('/home/vagrant/scripts/fileoper...