Skip to content
Snippets Groups Projects
Commit 72e36f78 authored by Simon Oehrl's avatar Simon Oehrl
Browse files

Fix errors

parent 16a32302
No related branches found
No related tags found
1 merge request!4Feature/add arbor support
Pipeline #163338 failed
...@@ -12,12 +12,12 @@ import time ...@@ -12,12 +12,12 @@ import time
import requests import requests
import psycopg2 import psycopg2
def ConnectToDatabase(): def ConnectToDatabase(postgres_username, postgres_password, port):
return psycopg2.connect(database="postgres", user=postgres_username, return psycopg2.connect(database="postgres", user=postgres_username,
password=postgres_password, host="database", port=str(port)) password=postgres_password, host="database", port=str(port))
def SetupNestTables(postgres_username, postgres_password, port): def SetupNestTables(postgres_username, postgres_password, port):
con = ConnectToDatabase() con = ConnectToDatabase(postgres_username, postgres_password, port)
print("Database connection opened successfully!") print("Database connection opened successfully!")
cur = con.cursor() cur = con.cursor()
...@@ -54,7 +54,7 @@ def SetupNestTables(postgres_username, postgres_password, port): ...@@ -54,7 +54,7 @@ def SetupNestTables(postgres_username, postgres_password, port):
print("Nest tables created successfully!\n") print("Nest tables created successfully!\n")
def SetupArborTables(postgres_username, postgres_password, port): def SetupArborTables(postgres_username, postgres_password, port):
con = ConnectToDatabase() con = ConnectToDatabase(postgres_username, postgres_password, port)
print("Database connection opened successfully!") print("Database connection opened successfully!")
cur = con.cursor() cur = con.cursor()
cur.execute("DROP TABLE IF EXISTS PROBES CASCADE") cur.execute("DROP TABLE IF EXISTS PROBES CASCADE")
...@@ -107,11 +107,11 @@ def main(): ...@@ -107,11 +107,11 @@ def main():
#SetupArborTables('postgres', 'docker', 5432) #SetupArborTables('postgres', 'docker', 5432)
# Wait for simulation nodes to post to database # Wait for simulation nodes to post to database
time.sleep(10) time.sleep(5)
# get simulation nodes # get simulation nodes
con = ConnectToDatabase() con = ConnectToDatabase('postgres', 'docker', 5432)
cur = con.cursor() cur = con.cursor()
# NEST # NEST
cur.execute("SELECT ADDRESS FROM SIMULATION_NODES") cur.execute("SELECT ADDRESS FROM SIMULATION_NODES")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment