From b6807d189568ad7beed2677f0701f1469eca64eb Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Tue, 16 May 2023 16:33:35 +0800 Subject: [PATCH] set domains --- appmanage/Dockerfile | 2 +- appmanage/api/service/manage.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/appmanage/Dockerfile b/appmanage/Dockerfile index ef28a3a5..d6cf741e 100644 --- a/appmanage/Dockerfile +++ b/appmanage/Dockerfile @@ -10,7 +10,7 @@ COPY static ./static COPY requirements.txt main.py ./ RUN apt update -# Install supervisord +# Install supervisords RUN apt install -y supervisor COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY config/cmd.sh /cmd.sh diff --git a/appmanage/api/service/manage.py b/appmanage/api/service/manage.py index e189bc72..d7fd420b 100644 --- a/appmanage/api/service/manage.py +++ b/appmanage/api/service/manage.py @@ -724,7 +724,7 @@ def app_domain_add(app_id, domain): old_domains = get_all_domains(app_id) if domain in old_domains: - raise CommandException(const.ERROR_CLIENT_PARAM_NOTEXIST, "Domain is binded", "") + raise CommandException(const.ERROR_CLIENT_PARAM_NOTEXIST, "Domain is in use", "") proxy = get_proxy(app_id) if proxy != None: @@ -800,7 +800,9 @@ def app_domain_add(app_id, domain): } response = requests.post(url, data=json.dumps(data), headers=headers) - if response.json()["error"] != None: + myLogger.info_logger(response.json()) + if response.json()["error"]: + myLogger.info_logger(response.json()) raise CommandException(const.ERROR_API_NGINX, response.json()["error"]["message"], "") set_domain(domain, app_id)