-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_listenaddress.py
60 lines (53 loc) · 1.58 KB
/
update_listenaddress.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
#!/usr/bin/python
#
# Author:[email protected]
#
# Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
#
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
#
# SOA on Docker Default Domain
#
# Updates the listen address for managed server with the IP address of the host.
#
# Since : April, 2016
# Author: [email protected]
# ==============================================
import sys
import os
import string
import socket
# Assigning values to variables
# ==================================
domain_name = os.environ.get("DOMAIN_NAME", "InfraDomain")
domain_root = os.environ.get("DOMAIN_ROOT", "/u01/oracle/user_projects/domains")
# Reading db details and schema prefix passed from parent script
# ==============================================================
print str(sys.argv[0]) + " called with the following sys.argv array:"
for index, arg in enumerate(sys.argv):
print "sys.argv[" + str(index) + "] = " + str(sys.argv[index])
server=sys.argv[1]
hostname = socket.gethostname()
infra_host= socket.gethostbyname(hostname)
print hostname
print infra_host
# Default Channel for ManagedServer
# ---------------------------------
# Setting domain path
# ===================
domain_path = domain_root + '/' + domain_name
print domain_path
# Read domain for updates
# =======================
readDomain(domain_path)
# Set listen address
# ==================
cd('/')
cd('/Servers/'+server)
cmo.setListenAddress(infra_host)
# Creating domain
# ==============================
updateDomain()
closeDomain()
exit()