-
Notifications
You must be signed in to change notification settings - Fork 0
/
exportClasspathArgument.py
84 lines (62 loc) · 1.98 KB
/
exportClasspathArgument.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
78
79
80
81
82
83
84
from java.io import FileInputStream
import sys, datetime
def expClasspath(csvLoc):
try:
out = open(csvLoc,'a+')
print('\n========== Export Classpaths ==========')
# Looping every Server
cd('/Servers')
redirect('/dev/null','false')
servers = ls(returnMap='true',returnType='c')
for server in servers:
cd('/Servers/'+ server +'/ServerStart/'+ server)
print('Servers: ' + server)
classpaths = cmo.getClassPath()
if str(classpaths) == "None" or str(classpaths) == '':
output = 'classpath,' + server + ',-' + '\n'
else:
output = 'classpath,' + server + ',' + str(classpaths) + '\n'
out.write(output)
out.close()
except Exception, e:
print e
def expArgument(csvLoc):
try:
out = open(csvLoc,'a+')
print('\n========== Export Arguments ==========')
# Looping every Server
cd('/Servers')
redirect('/dev/null','false')
servers = ls(returnMap='true',returnType='c')
for server in servers:
cd('/Servers/'+ server +'/ServerStart/'+ server)
print('Servers: ' + server)
argument = cmo.getArguments()
if str(argument) == "None" or str(argument) == '':
output = 'argument,' + server + ',-' + '\n'
else:
output = 'argument,' + server + ',' + str(argument) + '\n'
out.write(output)
out.close()
except Exception, e:
print e
def main():
propInputStream = FileInputStream(sys.argv[1])
configProps = Properties()
configProps.load(propInputStream)
adminUrl = configProps.get("adminUrl")
importUser = configProps.get("importUser")
importPassword = configProps.get("importPassword")
csvLoc = configProps.get("csvLoc")
#log = configProps.get("log")
connect(importUser, importPassword, adminUrl)
edit()
startEdit()
#date = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
#file = open(csvLoc)
expClasspath(csvLoc)
expArgument(csvLoc)
print('\n')
activate()
disconnect()
main()