forked from pvelder/wlst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenrollAdminServer.py
46 lines (44 loc) · 1.87 KB
/
enrollAdminServer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import os
import java
#=======================================================================================
# Get WebLogic home
#=======================================================================================
def getWeblogicHome():
return os.getenv('WL_HOME')
#=======================================================================================
# Get domain directory
#=======================================================================================
def getDomainDirectory():
return os.getenv('WL_DOMAIN_DIR')
#=======================================================================================
# Get node manager home
#=======================================================================================
def getNmHomeDirectory():
return getWeblogicHome() + '/common/nodemanager'
#=======================================================================================
# start and connect to adm server outside node manager process
#=======================================================================================
def startAdmServer():
url = 't3://' + adminListenAddress + ':' + adminListenPort
block = 'true'
timeout = 60000
startServer(serverName, domainName, url, systemUser, systemPassword, getDomainDirectory(), block, timeout) connect(systemUser, systemPassword, url)
def main():
try:
# BUG, if domainName is used then is NONE by the time nmConnect is invoked??
name=domainName
domainDirectory=getDomainDirectory()
# start amdserver
startAdmServer()
# enroll server
nmEnroll(domainDirectory, getNmHomeDirectory())
# shutdown adm server outside node manager process
shutdown()
# connect to node manager
nmConnect(nmUserName,nmPassword,adminListenAddress,nmPort,name,domainDirectory)
# start amdserver in nm process
nmStart(adminServerName, domainDirectory)
except:
dumpStack()
main()
exit()