From 844a960608435c5980d0ce8323565e2662362c0b Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 2 Feb 2015 16:38:58 -0500 Subject: [PATCH] linter: rm unused imports, shut the linter up --- endpoints/verbs.py | 10 ++++++---- formats/aci.py | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/endpoints/verbs.py b/endpoints/verbs.py index 8eb46bcc3..c14d8dcf0 100644 --- a/endpoints/verbs.py +++ b/endpoints/verbs.py @@ -2,11 +2,10 @@ import logging import json import hashlib -from flask import redirect, Blueprint, abort, send_file, request +from flask import redirect, Blueprint, abort, send_file from app import app from auth.auth import process_auth -from auth.auth_context import get_authenticated_user from auth.permissions import ReadRepositoryPermission from data import model from data import database @@ -15,11 +14,11 @@ from storage import Storage from util.queuefile import QueueFile from util.queueprocess import QueueProcess -from util.gzipwrap import GzipWrap from formats.squashed import SquashedDockerImage from formats.aci import ACIImage +# pylint: disable=invalid-name verbs = Blueprint('verbs', __name__) logger = logging.getLogger(__name__) @@ -45,7 +44,7 @@ def _open_stream(formatter, namespace, repository, tag, synthetic_image_id, imag current_image_path) current_image_id = current_image_entry.id - logger.debug('Returning image layer %s: %s' % (current_image_id, current_image_path)) + logger.debug('Returning image layer %s: %s', current_image_id, current_image_path) yield current_image_stream stream = formatter.build_stream(namespace, repository, tag, synthetic_image_id, image_json, @@ -76,8 +75,10 @@ def _write_synthetic_image_to_storage(verb, linked_storage_uuid, linked_location done_uploading.save() +# pylint: disable=too-many-locals def _repo_verb(namespace, repository, tag, verb, formatter, checker=None, **kwargs): permission = ReadRepositoryPermission(namespace, repository) + # pylint: disable=no-member if permission.can() or model.repository_is_public(namespace, repository): # Lookup the requested tag. try: @@ -168,6 +169,7 @@ def _repo_verb(namespace, repository, tag, verb, formatter, checker=None, **kwar @verbs.route('/aci/////aci///', methods=['GET']) @process_auth +# pylint: disable=unused-argument def get_aci_image(server, namespace, repository, tag, os, arch): def checker(image_json): # Verify the architecture and os. diff --git a/formats/aci.py b/formats/aci.py index 23ddfd43e..d425c4497 100644 --- a/formats/aci.py +++ b/formats/aci.py @@ -1,3 +1,5 @@ +# pylint: disable=missing-docstring,bad-continuation + from app import app from util.streamlayerformat import StreamLayerMerger from formats.tarimageformatter import TarImageFormatter @@ -5,10 +7,12 @@ from formats.tarimageformatter import TarImageFormatter import json import re + class ACIImage(TarImageFormatter): """ Image formatter which produces an ACI-compatible TAR. """ + # pylint: disable=too-many-arguments def stream_generator(self, namespace, repository, tag, synthetic_image_id, layer_json, get_image_iterator, get_layer_iterator): # ACI Format (.tar):