I am new to scripting and programing in general. I am trying to run WebSphere command line tool, wsadmin, and it keeps failing. I am looking for answers for 2 questions about the following code:
**import sys
import os
import re
execfile('wsadminlib.py')
appName = sys.argv[1]
configLocation = "/location/of/config/"
config_prop = open(configLocation + appName+"-Config.csv", "r")
for line in config_prop:
line = line.split(",")
print line**
I launch run the scripts in as wsadmin and from the command line is as follows:
>>>>./wsadmin.sh -lang jython -f deploy.sh param1
Questions:
- The problem is that it fails on the "for line in config_prop" with AttributeError: getitem?
- when I run this through python on the same machine, the code works. Just not when I run it through wsadmin tool?
- Is there other ways to extract data from txt or csv with comma delimited and setting a variable for each word that is only one line long.