-
Notifications
You must be signed in to change notification settings - Fork 1
/
createServer.py
44 lines (33 loc) · 1.03 KB
/
createServer.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
# borrow useful functions from:
# https://github.com/wsadminlib/wsadminlib
execfile('wsadminlib.py')
_nodeName = "myNode"
_serverName = "myServer"
_jvmProperties = [
['initialHeapSize', 128],
['maximumHeapSize', 512]
]
_properties = {
'myProperty1':'myValue1',
}
_environmentEntries = {
'TZ':'UTC'
}
# create server
print createServer(_nodeName, _serverName)
# TODO initial/max heap. These steps must not have worked
#jvm = AdminControl.completeObjectName('WebSphere:type=JVM,process=' + _serverName + ',*')
#AdminControl.setAttributes(jvm, _jvmProperties)
# custom properties
for prop in _properties.keys():
print createJvmProperty(_nodeName, _serverName, prop, _properties[prop])
# environment
for env in _environmentEntries.keys():
print createJvmEnvEntry(_nodeName, _serverName, env, _environmentEntries[env])
# process execution
setJvmExecutionUserGroup(_nodeName, _serverName, 'wasusr', 'wasgrp')
# TODO umask
# Save changes
if (AdminConfig.hasChanges()):
print "Saving changes"
AdminConfig.save()