This repository has been archived by the owner on Apr 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
install.py
76 lines (42 loc) · 1.63 KB
/
install.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
import os
libraryName = 'transport-kafka'
libraryFile = 'kafka-transport.jar'
appName = 'Service Bus Kafka Transport Provider'
appFile = 'kafka-transport.ear'
print '***** Service Bus Kafka Transport Install *****'
print ''
############################## Connect and Undeploy ###############################
connect()
appDeployment = cmo.lookupAppDeployment(appName)
if (appDeployment != None):
stopApplication(appName)
undeploy(appName)
library = cmo.lookupLibrary(libraryName)
if (library != None):
undeploy(libraryName)
########################## Retrieve Targets Information ###########################
targets = cmo.getAdminServerName()
clusters = cmo.getClusters()
for cluster in clusters:
targets = targets + ',' + cluster.getName()
servers = cmo.getServers()
for server in servers:
if (server.getCluster == None):
targets = targets + ',' + server.getName()
######################### Install and Start the Transport #########################
if (not os.path.exists(libraryFile)):
tmp = raw_input('Enter the location of the "kafka-transport.jar" file: ')
if (tmp.endswith(libraryFile)):
libraryFile = tmp
else:
libraryFile = os.path.join(tmp, libraryFile)
if (not os.path.exists(appFile)):
tmp = raw_input('Enter the location of the "kafka-transport.ear" file: ')
if (tmp.endswith(appFile)):
appFile = tmp
else:
appFile = os.path.join(tmp, appFile)
deploy(libraryName, libraryFile, targets=targets, libraryModule='true')
deploy(appName, appFile, targets=targets)
################################## Disconnect ####################################
disconnect()