Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
31afd055
Commit
31afd055
authored
6 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
fix(test_postgresql): type errors
parent
0e574985
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_postgresql.py
+13
-13
13 additions, 13 deletions
tests/test_postgresql.py
with
13 additions
and
13 deletions
tests/test_postgresql.py
+
13
−
13
View file @
31afd055
...
...
@@ -89,7 +89,7 @@ def get_nodes(conf: dict) -> dict:
name
=
elements
[
1
]
address
=
elements
[
2
].
split
(
"
:
"
)
host
=
address
[
0
]
port
=
address
[
1
]
port
=
int
(
address
[
1
]
)
rephacheck
=
elements
[
7
]
# update dictionary
...
...
@@ -146,8 +146,8 @@ def check_primary(nodes: dict) -> tuple:
"""
for
node
in
nodes
.
keys
():
host
=
nodes
[
node
][
"
address
"
]
port
=
nodes
[
node
][
"
rephacheck
"
]
host
=
nodes
[
node
][
"
host
"
]
port
=
int
(
nodes
[
node
][
"
rephacheck
"
]
)
if
get_node_state
(
host
,
port
)
==
"
primary
"
:
return
True
,
node
...
...
@@ -164,8 +164,8 @@ def check_standby(nodes: dict) -> tuple:
"""
for
node
in
nodes
.
keys
():
host
=
nodes
[
node
][
"
address
"
]
port
=
nodes
[
node
][
"
rephacheck
"
]
host
=
nodes
[
node
][
"
host
"
]
port
=
int
(
nodes
[
node
][
"
rephacheck
"
]
)
if
get_node_state
(
host
,
port
)
==
"
standby
"
:
return
True
,
node
...
...
@@ -182,8 +182,8 @@ def check_witness(nodes: dict) -> tuple:
"""
for
node
in
nodes
.
keys
():
host
=
nodes
[
node
][
"
address
"
]
port
=
nodes
[
node
][
"
rephacheck
"
]
host
=
nodes
[
node
][
"
host
"
]
port
=
int
(
nodes
[
node
][
"
rephacheck
"
]
)
if
get_node_state
(
host
,
port
)
==
"
witness
"
:
return
True
,
node
...
...
@@ -200,8 +200,8 @@ def check_fenced(nodes: dict) -> tuple:
"""
for
node
in
nodes
.
keys
():
host
=
nodes
[
node
][
"
address
"
]
port
=
nodes
[
node
][
"
rephacheck
"
]
host
=
nodes
[
node
][
"
host
"
]
port
=
int
(
nodes
[
node
][
"
rephacheck
"
]
)
if
get_node_state
(
host
,
port
)
==
"
fenced
"
:
return
True
,
node
...
...
@@ -390,7 +390,7 @@ def check_ha(db_conn: dict, errors: int = 0, warnings: int = 0) -> tuple:
# check remotes
for
node
in
nodes
:
node_host
=
nodes
[
node
][
"
address
"
]
node_host
=
nodes
[
node
][
"
host
"
]
node_port
=
nodes
[
node
][
"
port
"
]
if
not
check_listen
(
node_host
,
node_port
):
print
(
"
{}Cannot bind {}:{}{}
"
.
format
(
RED
,
node_host
,
node_port
,
DEF
))
...
...
@@ -497,9 +497,9 @@ def main():
conf
=
es_utils
.
load_conf
()
# get database configuration
db_host
=
conf
.
get
(
"
DB_HOST
"
,
"
127.0.0.1
"
)
db_port
=
int
(
conf
.
get
(
"
DB_PORT
"
,
5432
))
db_user
=
conf
.
get
(
"
DB_USER
"
,
"
postgres
"
)
db_host
=
conf
.
get
(
"
DB_HOST
"
)
if
conf
.
get
(
"
DB_HOST
"
)
else
"
127.0.0.1
"
db_port
=
int
(
conf
.
get
(
"
DB_PORT
"
))
if
conf
.
get
(
"
DB_PORT
"
)
else
5432
db_user
=
conf
.
get
(
"
DB_USER
"
)
if
conf
.
get
(
"
DB_USER
"
)
else
"
postgres
"
db_pass
=
conf
.
get
(
"
DB_PG_ROOT_PWD
"
)
db_conf
=
{
"
host
"
:
db_host
,
"
port
"
:
db_port
,
"
user
"
:
db_user
,
"
pass
"
:
db_pass
}
...
...
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