forked from pvelder/wlst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_config_AdminServer.py
77 lines (64 loc) · 2.64 KB
/
start_config_AdminServer.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import os
import java
#=======================================================================================
# Get domain directory
#=======================================================================================
def getDomainDirectory():
return domainsDirectory + '/' + domainName
#=======================================================================================
# Return which type of machine should be created
#=======================================================================================
def getMachineCreateType():
# On Unix, machine type is 'UnixMachine' on Windows it is 'Machine'
if os.pathsep == ':':
return 'UnixMachine'
else:
return 'Machine'
#=======================================================================================
# Get node manager home
#=======================================================================================
def getNmHomeDirectory():
wlsHome = str(java.lang.System.getProperty('pineapple.weblogic.home.path'))
return wlsHome + '/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)
#=======================================================================================
# shutdown adm server outside node manager process
#=======================================================================================
def shutdownAdmServer():
shutdown()
#=======================================================================================
# Configure node manager security
#=======================================================================================
def configureNodeManagerSecurity():
cd('/')
securityConfiguration = getMBean('/SecurityConfiguration/' + domainName)
if securityConfiguration == None:
securityConfiguration = create(domainName, 'SecurityConfiguration')
cd('/SecurityConfiguration/' + domainName)
cmo.setNodeManagerUsername(nmUserName)
cmo.setNodeManagerPassword(nmPassword)
def main():
try:
startAdmServer()
# set online edit mode
edit()
startEdit()
# configure node manager
configureNodeManagerSecurity()
#store wlst online change
showChanges()
save()
activate(block='true')
# shutdown admserver
shutdownAdmServer()
except:
dumpStack()
main()