Skip to content

Commit

Permalink
[artemiscloud#79] readinessProbe.sh-script fails
Browse files Browse the repository at this point in the history
Fix the readinessProbe.sh-script issue.
  • Loading branch information
aboucham committed Oct 9, 2023
1 parent f1fe0bb commit 5fefca8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions modules/activemq-artemis-launch/added/readinessProbe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ import socket
import sys
# calculate the open ports
try:
tcp_file = open("/proc/net/tcp", "r")
except IOError:
tcp_file = open("/proc/net/tcp6", "r")
tcp_lines = tcp_file.readlines()
header = tcp_lines.pop(0)
tcp_file.close()
tcp_lines = []
for tcp_file_path in ["/proc/net/tcp", "/proc/net/tcp6"]:
try:
tcp_file = open(tcp_file_path, "r")
lines = tcp_file.readlines()
header = lines.pop(0)
tcp_lines.extend(lines)
tcp_file.close()
except IOError:
print "Could not open {}".format(tcp_file_path)
listening_ports = []
for tcp_line in tcp_lines:
Expand All @@ -51,7 +54,7 @@ result=0
for acceptor in acceptors:
name = acceptor.get("name")
value = acceptor.text
value = acceptor.text.strip()
print "{} value {}".format(name, value)
spliturl = urlsplit(value)
port = spliturl.port
Expand All @@ -60,7 +63,7 @@ for acceptor in acceptors:
if port == None:
print " {} does not define a port, cannot check acceptor".format(name)
continue
result=1
try:
listening_ports.index(port)
Expand Down

0 comments on commit 5fefca8

Please sign in to comment.