linter: rm unused imports, shut the linter up

This commit is contained in:
Jimmy Zelinskie 2015-02-02 16:38:58 -05:00
parent a3afedfbbd
commit 844a960608
2 changed files with 10 additions and 4 deletions

View file

@ -2,11 +2,10 @@ import logging
import json import json
import hashlib import hashlib
from flask import redirect, Blueprint, abort, send_file, request from flask import redirect, Blueprint, abort, send_file
from app import app from app import app
from auth.auth import process_auth from auth.auth import process_auth
from auth.auth_context import get_authenticated_user
from auth.permissions import ReadRepositoryPermission from auth.permissions import ReadRepositoryPermission
from data import model from data import model
from data import database from data import database
@ -15,11 +14,11 @@ from storage import Storage
from util.queuefile import QueueFile from util.queuefile import QueueFile
from util.queueprocess import QueueProcess from util.queueprocess import QueueProcess
from util.gzipwrap import GzipWrap
from formats.squashed import SquashedDockerImage from formats.squashed import SquashedDockerImage
from formats.aci import ACIImage from formats.aci import ACIImage
# pylint: disable=invalid-name
verbs = Blueprint('verbs', __name__) verbs = Blueprint('verbs', __name__)
logger = logging.getLogger(__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_path)
current_image_id = current_image_entry.id 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 yield current_image_stream
stream = formatter.build_stream(namespace, repository, tag, synthetic_image_id, image_json, 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() done_uploading.save()
# pylint: disable=too-many-locals
def _repo_verb(namespace, repository, tag, verb, formatter, checker=None, **kwargs): def _repo_verb(namespace, repository, tag, verb, formatter, checker=None, **kwargs):
permission = ReadRepositoryPermission(namespace, repository) permission = ReadRepositoryPermission(namespace, repository)
# pylint: disable=no-member
if permission.can() or model.repository_is_public(namespace, repository): if permission.can() or model.repository_is_public(namespace, repository):
# Lookup the requested tag. # Lookup the requested tag.
try: try:
@ -168,6 +169,7 @@ def _repo_verb(namespace, repository, tag, verb, formatter, checker=None, **kwar
@verbs.route('/aci/<server>/<namespace>/<repository>/<tag>/aci/<os>/<arch>/', methods=['GET']) @verbs.route('/aci/<server>/<namespace>/<repository>/<tag>/aci/<os>/<arch>/', methods=['GET'])
@process_auth @process_auth
# pylint: disable=unused-argument
def get_aci_image(server, namespace, repository, tag, os, arch): def get_aci_image(server, namespace, repository, tag, os, arch):
def checker(image_json): def checker(image_json):
# Verify the architecture and os. # Verify the architecture and os.

View file

@ -1,3 +1,5 @@
# pylint: disable=missing-docstring,bad-continuation
from app import app from app import app
from util.streamlayerformat import StreamLayerMerger from util.streamlayerformat import StreamLayerMerger
from formats.tarimageformatter import TarImageFormatter from formats.tarimageformatter import TarImageFormatter
@ -5,10 +7,12 @@ from formats.tarimageformatter import TarImageFormatter
import json import json
import re import re
class ACIImage(TarImageFormatter): class ACIImage(TarImageFormatter):
""" Image formatter which produces an ACI-compatible TAR. """ Image formatter which produces an ACI-compatible TAR.
""" """
# pylint: disable=too-many-arguments
def stream_generator(self, namespace, repository, tag, synthetic_image_id, def stream_generator(self, namespace, repository, tag, synthetic_image_id,
layer_json, get_image_iterator, get_layer_iterator): layer_json, get_image_iterator, get_layer_iterator):
# ACI Format (.tar): # ACI Format (.tar):