diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-26 12:47:14 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-26 12:47:14 -0400 |
commit | 64eec5fe6a9b640bb77dd65f10f3fac5a586347c (patch) | |
tree | 3b3c86bda461ff2232b9f30b0d1e873f2b6a1b9a /src/lib/Bcfg2/Server/Plugin/interfaces.py | |
parent | 9673ba716310f50855cba74195e53878316af886 (diff) | |
download | bcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.tar.gz bcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.tar.bz2 bcfg2-64eec5fe6a9b640bb77dd65f10f3fac5a586347c.zip |
testsuite: fixed issues found by latest version of pep8
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugin/interfaces.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugin/interfaces.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin/interfaces.py b/src/lib/Bcfg2/Server/Plugin/interfaces.py index cb996b1ca..0fd711be9 100644 --- a/src/lib/Bcfg2/Server/Plugin/interfaces.py +++ b/src/lib/Bcfg2/Server/Plugin/interfaces.py @@ -337,12 +337,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 +408,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 +418,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): |