TT#121955 migrate missing files to structlog

Just to keep consistency on project

Change-Id: I8e2cec10baa92d00915229bb118be585492ac598
pull/5/head
Victor Seva 3 years ago
parent 504110f9e5
commit 6f043a0b9f

@ -12,13 +12,13 @@
# #
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import re import re
import urllib import urllib
from os import walk from os import walk
from pathlib import Path from pathlib import Path
from uuid import uuid4 from uuid import uuid4
import structlog
from yaml import load from yaml import load
from yaml import Loader from yaml import Loader
@ -26,7 +26,7 @@ from . import exceptions as err
from .conf import settings from .conf import settings
from repoapi.utils import open_jenkins_url from repoapi.utils import open_jenkins_url
logger = logging.getLogger(__name__) logger = structlog.get_logger(__name__)
base_url = ( base_url = (
"{base}/job/{job}/buildWithParameters?" "{base}/job/{job}/buildWithParameters?"

@ -1,4 +1,4 @@
# Copyright (C) 2016 The Sipwise Team - http://sipwise.com # Copyright (C) 2016-2022 The Sipwise Team - http://sipwise.com
# #
# This program is free software: you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by the Free
@ -12,16 +12,17 @@
# #
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import re import re
import structlog
from .models import WorkfrontNoteInfo from .models import WorkfrontNoteInfo
from debian.changelog import Changelog from debian.changelog import Changelog
from repoapi import utils from repoapi import utils
hotfix_re_release = re.compile(r".+~(mr[0-9]+\.[0-9]+\.[0-9]+.[0-9]+)$") hotfix_re_release = re.compile(r".+~(mr[0-9]+\.[0-9]+\.[0-9]+.[0-9]+)$")
logger = logging.getLogger(__name__) logger = structlog.get_logger(__name__)
def process_hotfix(jbi_info, projectname, path): def process_hotfix(jbi_info, projectname, path):

@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
import json import json
import logging
import re import re
from datetime import datetime from datetime import datetime
@ -22,8 +21,6 @@ from django_extensions.db.fields import ModificationDateTimeField
from .conf import settings from .conf import settings
logger = logging.getLogger(__name__)
class Project(models.Model): class Project(models.Model):
name = models.CharField(max_length=50, unique=True, null=False) name = models.CharField(max_length=50, unique=True, null=False)

@ -12,18 +12,18 @@
# #
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import urllib import urllib
import uuid import uuid
import requests import requests
import structlog
from requests.auth import HTTPBasicAuth from requests.auth import HTTPBasicAuth
from ..conf import settings from ..conf import settings
from ..models import Project from ..models import Project
from repoapi.utils import open_jenkins_url from repoapi.utils import open_jenkins_url
logger = logging.getLogger(__name__) logger = structlog.get_logger(__name__)
project_url = ( project_url = (
"{base}/job/{job}/buildWithParameters?" "{base}/job/{job}/buildWithParameters?"

@ -1,4 +1,4 @@
# Copyright (C) 2017 The Sipwise Team - http://sipwise.com # Copyright (C) 2017-2022 The Sipwise Team - http://sipwise.com
# #
# This program is free software: you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by the Free
@ -13,16 +13,16 @@
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
import json import json
import logging
import urllib import urllib
import uuid import uuid
import requests import requests
import structlog
from ..conf import settings from ..conf import settings
from repoapi.utils import open_jenkins_url from repoapi.utils import open_jenkins_url
logger = logging.getLogger(__name__) logger = structlog.get_logger(__name__)
docker_url = ( docker_url = (
"{base}/job/build-project-docker/buildWithParameters?" "{base}/job/build-project-docker/buildWithParameters?"

@ -1,4 +1,4 @@
# Copyright (C) 2015-2020 The Sipwise Team - http://sipwise.com # Copyright (C) 2015-2022 The Sipwise Team - http://sipwise.com
# #
# This program is free software: you can redistribute it and/or modify it # 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 # under the terms of the GNU General Public License as published by the Free
@ -13,9 +13,9 @@
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
import json import json
import logging
import uuid import uuid
import structlog
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.http import HttpResponseNotFound from django.http import HttpResponseNotFound
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
@ -44,7 +44,7 @@ from ..utils import build
from build.models import BuildRelease from build.models import BuildRelease
from build.utils import ReleaseConfig from build.utils import ReleaseConfig
logger = logging.getLogger(__name__) logger = structlog.get_logger(__name__)
@login_required @login_required

@ -12,9 +12,9 @@
# #
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
import re import re
import structlog
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.http import Http404 from django.http import Http404
from django.http import JsonResponse from django.http import JsonResponse
@ -37,7 +37,7 @@ from ..models import DockerTag
from ..models import Project from ..models import Project
from ..utils import docker from ..utils import docker
logger = logging.getLogger(__name__) logger = structlog.get_logger(__name__)
def _get_docker_tags(project, tag=None): def _get_docker_tags(project, tag=None):
@ -50,7 +50,7 @@ def _get_docker_tags(project, tag=None):
res = {"name": image} res = {"name": image}
tags = docker.get_docker_tags(image) tags = docker.get_docker_tags(image)
if tag: if tag:
logger.degug("non filtered tags: %s" % tags) logger.debug("non filtered tags: %s" % tags)
tags = filter(re.compile(tag).match, tags) tags = filter(re.compile(tag).match, tags)
res["tags"] = tags res["tags"] = tags
docker_tags.append(res) docker_tags.append(res)

Loading…
Cancel
Save