Skip to content
Snippets Groups Projects
Commit ce9c3e232984 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:pencil: create dict in one pass rather than two

parent 9ef54b2abded
No related branches found
No related tags found
1 merge request!145👕 fix flake8 B023
...@@ -79,9 +79,6 @@ ...@@ -79,9 +79,6 @@
for mount_dict in container.attrs["Mounts"]: for mount_dict in container.attrs["Mounts"]:
if mount_dict["Destination"] == "/var/run/postgresql": if mount_dict["Destination"] == "/var/run/postgresql":
source = mount_dict["Source"] source = mount_dict["Source"]
volumes = {}
volumes[pg_data_volume_name] = {
break break
if source: if source:
return container, lambda: stop_postgresql(container), source return container, lambda: stop_postgresql(container), source
...@@ -85,6 +82,9 @@ ...@@ -85,6 +82,9 @@
break break
if source: if source:
return container, lambda: stop_postgresql(container), source return container, lambda: stop_postgresql(container), source
"bind": "/var/lib/postgresql/data", volumes = {
"mode": "rw", pg_data_volume_name: {
"bind": "/var/lib/postgresql/data",
"mode": "rw",
}
} }
...@@ -90,4 +90,5 @@ ...@@ -90,4 +90,5 @@
} }
port_bindings = {} port_bindings = {}
if host_pg_port: if host_pg_port:
port_bindings[5432] = host_pg_port port_bindings[5432] = host_pg_port
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment