diff options
Diffstat (limited to 'rpkid/rpki/irdb')
-rw-r--r-- | rpkid/rpki/irdb/__init__.py | 2 | ||||
-rw-r--r-- | rpkid/rpki/irdb/models.py | 6 | ||||
-rw-r--r-- | rpkid/rpki/irdb/router.py | 4 | ||||
-rw-r--r-- | rpkid/rpki/irdb/zookeeper.py | 30 |
4 files changed, 19 insertions, 23 deletions
diff --git a/rpkid/rpki/irdb/__init__.py b/rpkid/rpki/irdb/__init__.py index 14365e10..64c9ee6c 100644 --- a/rpkid/rpki/irdb/__init__.py +++ b/rpkid/rpki/irdb/__init__.py @@ -19,6 +19,8 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ +# pylint: disable=W0401 + from rpki.irdb.models import * from rpki.irdb.zookeeper import Zookeeper from rpki.irdb.router import DBContextRouter, database diff --git a/rpkid/rpki/irdb/models.py b/rpkid/rpki/irdb/models.py index 8a41647d..e408612e 100644 --- a/rpkid/rpki/irdb/models.py +++ b/rpkid/rpki/irdb/models.py @@ -7,7 +7,7 @@ Django GUI code, so be careful. $Id$ -Copyright (C) 2011 Internet Systems Consortium ("ISC") +Copyright (C) 2011-2012 Internet Systems Consortium ("ISC") Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -22,6 +22,8 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ +# pylint: disable=W0232 + import django.db.models import rpki.x509 import rpki.sundial @@ -294,7 +296,7 @@ class CA(django.db.models.Model): return result def revoke(self, cert): - Revocations.objects.create( + Revocation.objects.create( issuer = self, revoked = rpki.sundial.now(), serial = cert.certificate.getSerial(), diff --git a/rpkid/rpki/irdb/router.py b/rpkid/rpki/irdb/router.py index 3036a58b..fad78b36 100644 --- a/rpkid/rpki/irdb/router.py +++ b/rpkid/rpki/irdb/router.py @@ -77,7 +77,7 @@ class database(object): def __init__(self, name, on_entry = None, on_exit = None): if not isinstance(name, str): - raise ValueError("database name must be a string, not %r" % value) + raise ValueError("database name must be a string, not %r" % name) self.name = name self.on_entry = on_entry self.on_exit = on_exit @@ -88,7 +88,7 @@ class database(object): self.former = DBContextRouter._database DBContextRouter._database = self.name - def __exit__(self, type, value, traceback): + def __exit__(self, _type, value, traceback): assert DBContextRouter._database is self.name DBContextRouter._database = self.former if self.on_exit is not None: diff --git a/rpkid/rpki/irdb/zookeeper.py b/rpkid/rpki/irdb/zookeeper.py index 49416b89..9747bb30 100644 --- a/rpkid/rpki/irdb/zookeeper.py +++ b/rpkid/rpki/irdb/zookeeper.py @@ -18,17 +18,10 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ -import subprocess -import csv -import re +# pylint: disable=W0612 + import os -import getopt -import sys -import base64 -import time -import glob import copy -import warnings import rpki.config import rpki.cli import rpki.sundial @@ -45,10 +38,9 @@ import rpki.irdb import django.db.transaction from lxml.etree import (Element, SubElement, ElementTree, - fromstring as ElementFromString, - tostring as ElementToString) + tostring as ElementToString) -from rpki.csv_utils import (csv_reader, csv_writer, BadCSVSyntax) +from rpki.csv_utils import csv_reader @@ -116,7 +108,7 @@ class PEM_writer(object): try: if compare and pem == open(filename, "r").read(): return - except: + except: # pylint: disable=W0702 pass tempname += ".%s.tmp" % os.getpid() mode = 0400 if filename.endswith(".key") else 0444 @@ -233,7 +225,7 @@ class Zookeeper(object): if handle is None: raise MissingHandle - self.handle= handle + self.handle = handle def set_logstream(self, logstream): @@ -529,7 +521,7 @@ class Zookeeper(object): try: self.resource_ca.children.get(handle = child_handle).delete() except rpki.irdb.Child.DoesNotExist: - self.log("No such child \"%s\"" % arg) + self.log("No such child \"%s\"" % child_handle) @django.db.transaction.commit_on_success @@ -605,7 +597,7 @@ class Zookeeper(object): try: self.resource_ca.parents.get(handle = parent_handle).delete() except rpki.irdb.Parent.DoesNotExist: - self.log("No such parent \"%s\"" % arg) + self.log("No such parent \"%s\"" % parent_handle) @django.db.transaction.commit_on_success @@ -724,7 +716,7 @@ class Zookeeper(object): try: self.server_ca.clients.get(handle = client_handle).delete() except rpki.irdb.Client.DoesNotExist: - self.log("No such client \"%s\"" % arg) + self.log("No such client \"%s\"" % client_handle) @django.db.transaction.commit_on_success @@ -773,9 +765,9 @@ class Zookeeper(object): assert repository_handle is not None try: - self.resource_ca.repositories.get(handle = arg).delete() + self.resource_ca.repositories.get(handle = repository_handle).delete() except rpki.irdb.Repository.DoesNotExist: - self.log("No such repository \"%s\"" % arg) + self.log("No such repository \"%s\"" % repository_handle) @django.db.transaction.commit_on_success |