diff --git a/build/tasks.py b/build/tasks.py
index ee0d226..39074ef 100644
--- a/build/tasks.py
+++ b/build/tasks.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 The Sipwise Team - http://sipwise.com
+# Copyright (C) 2017-2020 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@@ -12,9 +12,8 @@
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
-import logging
-
from celery import shared_task
+from celery.utils.log import get_task_logger
from .conf import settings
from build.models.br import BuildRelease
@@ -22,7 +21,7 @@ from build.utils import trigger_build
from build.utils import trigger_copy_deps
from repoapi.celery import app
-logger = logging.getLogger(__name__)
+logger = get_task_logger(__name__)
@app.task(bind=True)
@@ -37,7 +36,9 @@ def build_release(self, pk):
else:
release = instance.release
url = trigger_copy_deps(
- release=release, internal=True, release_uuid=instance.uuid,
+ release=release,
+ internal=True,
+ release_uuid=instance.uuid,
)
logger.info("%s triggered" % url)
diff --git a/hotfix/tasks.py b/hotfix/tasks.py
index 8e705c5..4536a49 100644
--- a/hotfix/tasks.py
+++ b/hotfix/tasks.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 The Sipwise Team - http://sipwise.com
+# Copyright (C) 2016-2020 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@@ -12,14 +12,13 @@
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
-import logging
-
from celery import shared_task
+from celery.utils.log import get_task_logger
from .utils import process_hotfix
from repoapi.models import JenkinsBuildInfo
-logger = logging.getLogger(__name__)
+logger = get_task_logger(__name__)
@shared_task(ignore_result=True)
diff --git a/release_changed/tasks.py b/release_changed/tasks.py
index 8786e00..021f9ff 100644
--- a/release_changed/tasks.py
+++ b/release_changed/tasks.py
@@ -13,14 +13,14 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
import json
-import logging
from celery import shared_task
+from celery.utils.log import get_task_logger
from django.apps import apps
from .models import ReleaseChanged
-logger = logging.getLogger(__name__)
+logger = get_task_logger(__name__)
@shared_task(ignore_result=True)
@@ -32,7 +32,8 @@ def process_result(jbi_id, path_envVars):
info = data["envMap"]
if info["vmdone"] == "yes":
ReleaseChanged.objects.filter(
- version=info["vmversion"], vmtype=info["vmtype"],
+ version=info["vmversion"],
+ vmtype=info["vmtype"],
).delete()
logger.info("{}_{} deleted".format(info["vmtype"], info["vmversion"]))
return
diff --git a/release_dashboard/tasks.py b/release_dashboard/tasks.py
index ff073e1..158b7fb 100644
--- a/release_dashboard/tasks.py
+++ b/release_dashboard/tasks.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 The Sipwise Team - http://sipwise.com
+# Copyright (C) 2016-2020 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
@@ -12,9 +12,8 @@
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
-import logging
-
from celery import shared_task
+from celery.utils.log import get_task_logger
from .conf import settings
from .models import DockerImage
@@ -23,7 +22,7 @@ from .models import Project
from .utils import build
from .utils import docker
-logger = logging.getLogger(__name__)
+logger = get_task_logger(__name__)
@shared_task(ignore_result=True)
diff --git a/repoapi/tasks.py b/repoapi/tasks.py
index bec68d8..9b981f0 100644
--- a/repoapi/tasks.py
+++ b/repoapi/tasks.py
@@ -13,11 +13,11 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
import json
-import logging
from datetime import timedelta
from os.path import basename
from celery import shared_task
+from celery.utils.log import get_task_logger
from django.apps import apps
from .celery import app
@@ -29,7 +29,7 @@ from .utils import jenkins_get_build
from .utils import jenkins_get_console
from .utils import jenkins_get_env
-logger = logging.getLogger(__name__)
+logger = get_task_logger(__name__)
@shared_task(ignore_result=True)