summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-11 08:01:39 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-11 08:01:39 -0400
commit439e72b36f66855cfb66de111147a4b92e80da19 (patch)
treec5fcafeab2800446793e4600976e21cd05a4669b /src/lib/Bcfg2
parentaaa2d3230082eb283c34e308250da1381d181365 (diff)
downloadbcfg2-439e72b36f66855cfb66de111147a4b92e80da19.tar.gz
bcfg2-439e72b36f66855cfb66de111147a4b92e80da19.tar.bz2
bcfg2-439e72b36f66855cfb66de111147a4b92e80da19.zip
added PEP-8 style checks to test suite
Diffstat (limited to 'src/lib/Bcfg2')
-rw-r--r--src/lib/Bcfg2/Compat.py4
-rw-r--r--src/lib/Bcfg2/Proxy.py3
-rw-r--r--src/lib/Bcfg2/Server/Plugin/interfaces.py1
-rw-r--r--src/lib/Bcfg2/Server/Plugins/DBStats.py5
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Apt.py2
5 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Compat.py b/src/lib/Bcfg2/Compat.py
index b0f0ef5cf..4bcc76e8f 100644
--- a/src/lib/Bcfg2/Compat.py
+++ b/src/lib/Bcfg2/Compat.py
@@ -51,7 +51,8 @@ except ImportError:
# xmlrpc imports
try:
- import xmlrpclib, SimpleXMLRPCServer
+ import xmlrpclib
+ import SimpleXMLRPCServer
except ImportError:
import xmlrpc.client as xmlrpclib
import xmlrpc.server as SimpleXMLRPCServer
@@ -73,6 +74,7 @@ try:
except NameError:
unicode = str
+
def u_str(string, encoding=None):
""" print to file compatibility """
if sys.hexversion >= 0x03000000:
diff --git a/src/lib/Bcfg2/Proxy.py b/src/lib/Bcfg2/Proxy.py
index 3b406c78e..3aefed5d1 100644
--- a/src/lib/Bcfg2/Proxy.py
+++ b/src/lib/Bcfg2/Proxy.py
@@ -51,13 +51,16 @@ class ProxyError(Exception):
msg = str(err)
Exception.__init__(self, msg)
+
class CertificateError(Exception):
def __init__(self, commonName):
self.commonName = commonName
+
def __str__(self):
return ("Got unallowed commonName %s from server"
% self.commonName)
+
_orig_Method = xmlrpclib._Method
class RetryMethod(xmlrpclib._Method):
diff --git a/src/lib/Bcfg2/Server/Plugin/interfaces.py b/src/lib/Bcfg2/Server/Plugin/interfaces.py
index f42ada773..cb996b1ca 100644
--- a/src/lib/Bcfg2/Server/Plugin/interfaces.py
+++ b/src/lib/Bcfg2/Server/Plugin/interfaces.py
@@ -313,6 +313,7 @@ class Threaded(object):
"""
raise NotImplementedError
+
class ThreadedStatistics(Statistics, Threaded, threading.Thread):
""" ThreadedStatistics plugins process client statistics in a
separate thread. """
diff --git a/src/lib/Bcfg2/Server/Plugins/DBStats.py b/src/lib/Bcfg2/Server/Plugins/DBStats.py
index e0794f019..e6ef50fa1 100644
--- a/src/lib/Bcfg2/Server/Plugins/DBStats.py
+++ b/src/lib/Bcfg2/Server/Plugins/DBStats.py
@@ -9,7 +9,6 @@ class DBStats(Bcfg2.Server.Plugin.Plugin):
def __init__(self, core, datastore):
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
self.logger.error("DBStats has been replaced with Reporting")
- self.logger.error("DBStats: Be sure to migrate your data "\
- "before running the report collector")
+ self.logger.error("DBStats: Be sure to migrate your data "
+ "before running the report collector")
raise Bcfg2.Server.Plugin.PluginInitError
-
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py b/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py
index ec0d8e828..27f493677 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Apt.py
@@ -35,7 +35,7 @@ class AptCollection(Collection):
for source in self:
if source.rawurl:
- self.logger.info("Packages: Skipping rawurl %s" %
+ self.logger.info("Packages: Skipping rawurl %s" %
source.rawurl)
else:
lines.append("deb %s %s %s" % (source.url, source.version,