diff options
author | Rob Austein <sra@hactrn.net> | 2014-05-29 22:31:15 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-05-29 22:31:15 +0000 |
commit | 35c1ca65ac2b5cbd943248d59b3e02c6220b232f (patch) | |
tree | bf2daf07febf7cb352b8fcd530e62a1e5df89626 /rpki/irdb | |
parent | 07a045d1259f30878abba416b86373c05c929965 (diff) |
PyLint
svn path=/trunk/; revision=5845
Diffstat (limited to 'rpki/irdb')
-rw-r--r-- | rpki/irdb/__init__.py | 6 | ||||
-rw-r--r-- | rpki/irdb/models.py | 24 | ||||
-rw-r--r-- | rpki/irdb/router.py | 6 | ||||
-rw-r--r-- | rpki/irdb/zookeeper.py | 40 |
4 files changed, 35 insertions, 41 deletions
diff --git a/rpki/irdb/__init__.py b/rpki/irdb/__init__.py index cc83387e..7f3b880e 100644 --- a/rpki/irdb/__init__.py +++ b/rpki/irdb/__init__.py @@ -1,11 +1,11 @@ # $Id$ -# +# # 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 # copyright notice and this permission notice appear in all copies. -# +# # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, diff --git a/rpki/irdb/models.py b/rpki/irdb/models.py index 1ad9b4e3..6fa48c59 100644 --- a/rpki/irdb/models.py +++ b/rpki/irdb/models.py @@ -1,12 +1,12 @@ # $Id$ -# +# # Copyright (C) 2013--2014 Dragon Research Labs ("DRL") # Portions 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 # copyright notices and this permission notice appear in all copies. -# +# # THE SOFTWARE IS PROVIDED "AS IS" AND DRL AND ISC DISCLAIM ALL # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DRL OR @@ -24,7 +24,7 @@ to be usable by command line programs and other scripts, not just Django GUI code, so be careful. """ -# pylint: disable=W0232 +# pylint: disable=W0232,C1001 import django.db.models import rpki.x509 @@ -389,7 +389,7 @@ class ServerRevocation(Revocation): class ResourceHolderRevocation(Revocation): issuer = django.db.models.ForeignKey(ResourceHolderCA, related_name = "revocations") - + class EECertificate(Certificate): private_key = RSAKeyField() @@ -637,10 +637,10 @@ class Client(CrossCertification): # for Django South -- these are just simple subclasses add_introspection_rules([], - ('^rpki\.irdb\.models\.CertificateField', - '^rpki\.irdb\.models\.CRLField', - '^rpki\.irdb\.models\.EnumField', - '^rpki\.irdb\.models\.HandleField', - '^rpki\.irdb\.models\.RSAKeyField', - '^rpki\.irdb\.models\.SignedReferralField', - '^rpki\.irdb\.models\.SundialField')) + (r'^rpki\.irdb\.models\.CertificateField', + r'^rpki\.irdb\.models\.CRLField', + r'^rpki\.irdb\.models\.EnumField', + r'^rpki\.irdb\.models\.HandleField', + r'^rpki\.irdb\.models\.RSAKeyField', + r'^rpki\.irdb\.models\.SignedReferralField', + r'^rpki\.irdb\.models\.SundialField')) diff --git a/rpki/irdb/router.py b/rpki/irdb/router.py index 1f27d0c9..97e3d0b7 100644 --- a/rpki/irdb/router.py +++ b/rpki/irdb/router.py @@ -1,11 +1,11 @@ # $Id$ -# +# # Copyright (C) 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 # copyright notice and this permission notice appear in all copies. -# +# # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, diff --git a/rpki/irdb/zookeeper.py b/rpki/irdb/zookeeper.py index 78783e6b..cd996c7e 100644 --- a/rpki/irdb/zookeeper.py +++ b/rpki/irdb/zookeeper.py @@ -1,12 +1,12 @@ # $Id$ -# +# # Copyright (C) 2013--2014 Dragon Research Labs ("DRL") # Portions copyright (C) 2009--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 # copyright notices and this permission notice appear in all copies. -# +# # THE SOFTWARE IS PROVIDED "AS IS" AND DRL AND ISC DISCLAIM ALL # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DRL OR @@ -20,7 +20,7 @@ Management code for the IRDB. """ -# pylint: disable=W0612 +# pylint: disable=W0612,C0325 import os import copy @@ -45,8 +45,6 @@ from lxml.etree import (Element, SubElement, ElementTree, from rpki.csv_utils import csv_reader - - # XML namespace and protocol version for OOB setup protocol. The name # is historical and may change before we propose this as the basis for # a standard. @@ -80,7 +78,6 @@ class BadXMLMessage(Exception): "Bad XML message." class PastExpiration(Exception): "Expiration date has already passed." class CantRunRootd(Exception): "Can't run rootd." - def B64Element(e, tag, obj, **kwargs): """ @@ -135,8 +132,6 @@ class PEM_writer(object): os.rename(tempname, filename) self.wrote.add(filename) - - def etree_read(filename): """ @@ -192,10 +187,9 @@ class etree_wrapper(object): @property def file(self): - from cStringIO import StringIO + from cStringIO import StringIO return StringIO(ElementToString(self.etree)) - class Zookeeper(object): @@ -464,7 +458,7 @@ class Zookeeper(object): self.log("Regenerating Server BPKI CRL") self.server_ca.generate_crl() self.server_ca.save() - + for ca in rpki.irdb.ResourceHolderCA.objects.all(): self.log("Regenerating BPKI CRL for Resource Holder %s" % ca.handle) ca.generate_crl() @@ -519,7 +513,7 @@ class Zookeeper(object): parent_handle = parent.handle, bpki_cms_cert = parent.certificate) for parent in rpki.irdb.Parent.objects.all()) - + updates.extend( rpki.left_right.parent_elt.make_pdu( action = "set", @@ -786,7 +780,7 @@ class Zookeeper(object): if sia_base is None: self.log("Don't know where to nest this client, defaulting to top-level") sia_base = "rsync://%s/%s/%s/" % (self.rsync_server, self.rsync_module, client.get("handle")) - + if not sia_base.startswith("rsync://"): raise BadXMLMessage("Malformed sia_base parameter %r, should start with 'rsync://'" % sia_base) @@ -1219,7 +1213,7 @@ class Zookeeper(object): to whack everything into sync should call this when they're done, but be warned that this can be slow with a lot of CAs. - Any arguments given are handles of CAs which should be poked with a + Any arguments given are handles of CAs which should be poked with a <self run_now="yes"/> operation. """ @@ -1617,12 +1611,12 @@ class Zookeeper(object): pkcs10 = pkcs10, gski = pkcs10.gSKI(), valid_until = resources.valid_until) - for range in resources.asn: - ee_request.asns.create(start_as = str(range.min), end_as = str(range.max)) - for range in resources.v4: - ee_request.address_ranges.create(start_ip = str(range.min), end_ip = str(range.max), version = 4) - for range in resources.v6: - ee_request.address_ranges.create(start_ip = str(range.min), end_ip = str(range.max), version = 6) + for r in resources.asn: + ee_request.asns.create(start_as = str(r.min), end_as = str(r.max)) + for r in resources.v4: + ee_request.address_ranges.create(start_ip = str(r.min), end_ip = str(r.max), version = 4) + for r in resources.v6: + ee_request.address_ranges.create(start_ip = str(r.min), end_ip = str(r.max), version = 6) @django.db.transaction.commit_on_success @@ -1669,8 +1663,8 @@ class Zookeeper(object): sn = sn, eku = rpki.oids.id_kp_bgpsec_router) - for range in asns: - ee_request.asns.create(start_as = str(range.min), end_as = str(range.max)) + for r in asns: + ee_request.asns.create(start_as = str(r.min), end_as = str(r.max)) @django.db.transaction.commit_on_success |