Skip to content

Commit 4c7a2b4

Browse files
committed
Fix logic error when getting real listen ports
1 parent c7fe574 commit 4c7a2b4

File tree

1 file changed

+18
-2
lines changed
  • operator/src/main/resources/scripts

1 file changed

+18
-2
lines changed

operator/src/main/resources/scripts/utils.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,26 @@ def get_server_template_listening_ports_from_configxml(config_xml):
8484
if template.parentNode.nodeName != 'domain':
8585
continue
8686
template_name = template.getElementsByTagName('name')[0].firstChild.nodeValue
87+
# Get listen port
8788
listen_ports = template.getElementsByTagName('listen-port')
88-
if len(listen_ports) > 0:
89-
port = listen_ports[0].firstChild.nodeValue
89+
90+
for listen_port in listen_ports:
91+
if listen_port.parentNode.nodeName == 'server-template':
92+
port = listen_port.firstChild.nodeValue
93+
break
9094
server_template_ports[template_name] = port
95+
96+
# naps = template.getElementsByTagName('network-access-point')
97+
# for nap in naps:
98+
# nap_listen_ports = nap.getElementsByTagName('listen-port')
99+
# if len(listen_ports) > 0:
100+
# nap_listen_port = nap_listen_ports[0].firstChild.nodeValue
101+
# nap_name = nap.getElementsByTagName('name')[0].firstChild.nodeValue
102+
# nap_protcols = nap.getElementsByTagName('protocol')
103+
# # there is protocol defined:
104+
# if len(nap_protcols) > 0:
105+
106+
# Get ssl port
91107
ssls = template.getElementsByTagName('ssl')
92108
if len(ssls) > 0:
93109
ssl = ssls.item(0)

0 commit comments

Comments
 (0)