Python script to connect with weblogic Admin server

I have written a python script to connect with weblogic Admin server through WLST script. I have used storeUserConfig() funxtion in WLST to store username and password in a file. So I dont want to specify it when I run connect function. I am getting below error when I run my code. I have attached the code. The "wl" which I have imported is the file contains WLST functions imported as Jython module. If I specify command as connect('weblogic', 'weblogic', t3://localhost:7001) it works.
import wl
serverName = 't3://localhost:7001'
userconfig = '/usr/local/bea/'
userkey = '/usr/local/bea/'
wl.connect(userConfigFile=userconfig, userKeyFile=userkey, serverName)

Open in new window

Who is Participating?
girionisConnect With a Mentor Commented:
What happens if you do this

wl.connect(userConfigFile=userconfig, userKeyFile=userkey, url=serverName)

or even

wl.connect(userConfigFile='/usr/local/bea/', userKeyFile='/usr/local/bea/', url='t3://localhost:7001')
ramromconsultant Commented:
The error is almost self-explanatory: you have a non-keyword argument (serverName) following a keyword argument (userKeyFile=userkey).

I don't know what wl.connect expects, but you can't do it that way!
Jayamurugan83Author Commented:
Ok. Then I tried with this command.

wl.connect(userConfigFile=userconfig, userKeyFile=userkey, t3://localhost:7001)

it doesnt work as well

wl is another python file which got all WLST functions imported as Jython module.
Jayamurugan83Author Commented:
Thank you so much. I used url=serverName and it works.
Nice one, thanks for accepting :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.