summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugin/interfaces.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugin/interfaces.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugin/interfaces.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin/interfaces.py b/src/lib/Bcfg2/Server/Plugin/interfaces.py
index cb996b1ca..222b94fe3 100644
--- a/src/lib/Bcfg2/Server/Plugin/interfaces.py
+++ b/src/lib/Bcfg2/Server/Plugin/interfaces.py
@@ -286,6 +286,8 @@ class Statistics(Plugin):
you should avoid using Statistics and use
:class:`ThreadedStatistics` instead."""
+ create = False
+
def process_statistics(self, client, xdata):
""" Process the given XML statistics data for the specified
client.
@@ -337,12 +339,11 @@ class ThreadedStatistics(Statistics, Threaded, threading.Thread):
pending_data = []
try:
while not self.work_queue.empty():
- (metadata, data) = self.work_queue.get_nowait()
- pending_data.append(
- (metadata.hostname,
- lxml.etree.tostring(
- data,
- xml_declaration=False).decode("UTF-8")))
+ (metadata, xdata) = self.work_queue.get_nowait()
+ data = \
+ lxml.etree.tostring(xdata,
+ xml_declaration=False).decode("UTF-8")
+ pending_data.append((metadata.hostname, data))
except Empty:
pass
@@ -409,7 +410,7 @@ class ThreadedStatistics(Statistics, Threaded, threading.Thread):
def run(self):
if not self._load():
return
- while not self.terminate.isSet() and self.work_queue != None:
+ while not self.terminate.isSet() and self.work_queue is not None:
try:
(client, xdata) = self.work_queue.get(block=True, timeout=2)
except Empty:
@@ -419,7 +420,7 @@ class ThreadedStatistics(Statistics, Threaded, threading.Thread):
self.logger.error("ThreadedStatistics: %s" % err)
continue
self.handle_statistic(client, xdata)
- if self.work_queue != None and not self.work_queue.empty():
+ if self.work_queue is not None and not self.work_queue.empty():
self._save()
def process_statistics(self, metadata, data):
@@ -527,6 +528,8 @@ class GoalValidator(object):
class Version(Plugin):
""" Version plugins interact with various version control systems. """
+ create = False
+
#: The path to the VCS metadata file or directory, relative to the
#: base of the Bcfg2 repository. E.g., for Subversion this would
#: be ".svn"