Monday, July 25, 2011

wlst execfile sys.argv

execfile('import.py')

fails with a exceptions.IndexError because the import.py does a

importToALSBDomain(sys.argv[1])


and nothing is specified for sys.argv[1]

Unfortunately

execfile('import.py import.properties')

doesn't work
IOError: File not found - import.py import.properties (No such file or directory)

nor

execfile('import.py', 'import.properties')

it gives me a
sequence subscript must be integer or slice

(god only knows what it is trying to do)


All in all, it seems that the only way to pass parameters to a script is by invoking it directly from the command line (java weblogic.WLST import.py import.properties)
or using the Ant equivalent.

It could be worse... it could be raining...



No comments: