mirror of
https://github.com/nasa/trick.git
synced 2024-12-21 14:07:51 +00:00
Ported to python 3.6.13
This commit is contained in:
parent
644e945c79
commit
0db8f7afc5
@ -87,11 +87,12 @@ params = Params()
|
||||
def is_web_server_started():
|
||||
for _ in range(20): #Wait 2 seconds i.e 20 * .1 seconds, must wait for service to get to listening state.
|
||||
cmd = f"echo \"netstat -tulpan | grep {params.get_port()}\" | /bin/bash"
|
||||
p = subprocess.run(cmd, capture_output=True, shell=True)
|
||||
# p = subprocess.run(cmd, capture_output=True, shell=True)
|
||||
output = subprocess.getoutput(cmd)
|
||||
print("runing........", cmd)
|
||||
print(f"Checking for port output: {p.stdout}")
|
||||
print(f"Error is: {p.stderr}")
|
||||
print(f"Checking for port output: {output}")
|
||||
print(f"Error is: {output}")
|
||||
sleep(.1) #We sleep to use less recourses
|
||||
if "LISTEN" in p.stdout.decode():
|
||||
if "LISTEN" in output:
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user