Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
access-node
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LuFG VR VIS
VR-Group
In Situ Pipeline
access-node
Commits
1c2a11cb
Commit
1c2a11cb
authored
4 years ago
by
Simon Oehrl
Browse files
Options
Downloads
Patches
Plain Diff
Fix database host
parent
b6d33732
No related branches found
No related tags found
No related merge requests found
Pipeline
#163361
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
access_node/__main__.py
+7
-4
7 additions, 4 deletions
access_node/__main__.py
with
7 additions
and
4 deletions
access_node/__main__.py
+
7
−
4
View file @
1c2a11cb
...
...
@@ -12,9 +12,12 @@ import time
import
requests
import
psycopg2
def
ConnectToDatabase
(
postgres_username
,
postgres_password
,
port
):
return
psycopg2
.
connect
(
database
=
"
postgres
"
,
user
=
postgres_username
,
password
=
postgres_password
,
host
=
"
database
"
,
port
=
str
(
port
))
def
ConnectToDatabase
(
postgres_username
,
postgres_password
):
database_host
=
'
database
'
with
open
(
'
database_host.txt
'
)
as
database_host_file
:
database_host
=
database_host_file
.
readline
()
return
psycopg2
.
connect
(
database
=
"
postgres
"
,
user
=
"
postgres
"
,
password
=
"
postgres
"
,
host
=
database_host
,
port
=
"
5432
"
)
def
main
():
...
...
@@ -22,7 +25,7 @@ def main():
time
.
sleep
(
5
)
# get simulation nodes
con
=
ConnectToDatabase
(
'
postgres
'
,
'
postgres
'
,
5432
)
con
=
ConnectToDatabase
(
'
postgres
'
,
'
postgres
'
)
cur
=
con
.
cursor
()
# NEST
cur
.
execute
(
"
SELECT address FROM nest_simulation_node
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment