From ae70b53074be91ab179f1f27451930ecedd8d803 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sun, 2 Sep 2018 22:09:54 +0200 Subject: [PATCH] Fix URL compilation for AppMgr confupdate which expects only host --- basic/srv/spotter/appmgr/__init__.py | 2 +- basic/srv/spotter/appmgr/tools.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/basic/srv/spotter/appmgr/__init__.py b/basic/srv/spotter/appmgr/__init__.py index 04209ca..321aa08 100644 --- a/basic/srv/spotter/appmgr/__init__.py +++ b/basic/srv/spotter/appmgr/__init__.py @@ -256,7 +256,7 @@ class AppMgr: def update_apps_urls(self): # Update configuration for respective applications - confupdater.update_url(tools.compile_url(self.domain, self.port)) + confupdater.update_url(tools.compile_url(self.domain, self.port, None)) # Restart currently running apps in order to update config and re-register nginx proxy for app in self.conf['apps']: if tools.is_service_started(app): diff --git a/basic/srv/spotter/appmgr/tools.py b/basic/srv/spotter/appmgr/tools.py index 4d420e8..c3630ef 100644 --- a/basic/srv/spotter/appmgr/tools.py +++ b/basic/srv/spotter/appmgr/tools.py @@ -13,7 +13,8 @@ NULL_IP = '[100::1]' def compile_url(domain, port, proto='https'): port = ':{}'.format(port) if (proto == 'https' and port != '443') or (proto == 'http' and port != '80') else '' - return '{}://{}{}'.format(proto, domain, port) + host = '{}{}'.format(domain, port) + return '{}://{}'.format(proto, host) if proto is not None else host def get_container_ip(app): # Return an IP address of a container. If the container is not running, return address from IPv6 discard prefix instead