Fix DockerHandler and NginxHandler bugs

This commit is contained in:
DerTyp7
2023-12-12 13:27:35 +01:00
parent 732650e31e
commit 5775cb087a
6 changed files with 23 additions and 36 deletions

View File

@@ -25,7 +25,6 @@ class NginxHandler:
logging.info(f.read())
def setup_config_file(self, port_map, current_container_ip, docker_handler):
print(f'-------------------> {port_map}')
if port_map is None:
logging.error('port_map is None')
return
@@ -47,9 +46,7 @@ class NginxHandler:
# Example for the nginx-example.conf file is in the repo root directory
if isinstance(port_map, dict):
for port in port_map:
print(f'-------------------> {port_map}')
ip = docker_handler.get_ip_by_dns_name(port_map[port])
print(f'-------------------> {port_map[port]}, {ip}')
nginx_conf.write(f' upstream upstream_{port} {{\n')
nginx_conf.write(f' server {ip}:25565;\n')