From 64eec5fe6a9b640bb77dd65f10f3fac5a586347c Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 26 Mar 2013 12:47:14 -0400 Subject: testsuite: fixed issues found by latest version of pep8 --- src/lib/Bcfg2/Server/FileMonitor/Fam.py | 2 +- src/lib/Bcfg2/Server/FileMonitor/Pseudo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Server/FileMonitor') diff --git a/src/lib/Bcfg2/Server/FileMonitor/Fam.py b/src/lib/Bcfg2/Server/FileMonitor/Fam.py index 253bb2801..09d41038e 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Fam.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Fam.py @@ -51,7 +51,7 @@ class Fam(FileMonitor): else: handle = self.filemonitor.monitorFile(path, None) self.handles[handle.requestID()] = handle - if obj != None: + if obj is not None: self.users[handle.requestID()] = obj return handle.requestID() AddMonitor.__doc__ = FileMonitor.AddMonitor.__doc__ diff --git a/src/lib/Bcfg2/Server/FileMonitor/Pseudo.py b/src/lib/Bcfg2/Server/FileMonitor/Pseudo.py index 24cd099d0..b1e1adab7 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Pseudo.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Pseudo.py @@ -24,6 +24,6 @@ class Pseudo(FileMonitor): self.events.append(Event(handleID, fname, 'exists')) self.events.append(Event(handleID, path, 'endExist')) - if obj != None: + if obj is not None: self.handles[handleID] = obj return handleID -- cgit v1.2.3-1-g7c22 From 810bed32be1edf6c79cf0952029d31339461eaf9 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 27 Mar 2013 13:39:00 -0400 Subject: Inotify: use correct logger --- src/lib/Bcfg2/Server/FileMonitor/Inotify.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib/Bcfg2/Server/FileMonitor') diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py index cdd52dbb9..2cdf27ed8 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py @@ -3,14 +3,11 @@ support. """ import os import errno -import logging import pyinotify from Bcfg2.Compat import reduce # pylint: disable=W0622 from Bcfg2.Server.FileMonitor import Event from Bcfg2.Server.FileMonitor.Pseudo import Pseudo -LOGGER = logging.getLogger(__name__) - class Inotify(Pseudo, pyinotify.ProcessEvent): """ File monitor backend with `inotify @@ -123,8 +120,9 @@ class Inotify(Pseudo, pyinotify.ProcessEvent): try: watch = self.watchmgr.watches[ievent.wd] except KeyError: - LOGGER.error("Error handling event %s for %s: Watch %s not found" % - (action, ievent.pathname, ievent.wd)) + self.logger.error("Error handling event %s for %s: " + "Watch %s not found" % + (action, ievent.pathname, ievent.wd)) return # FAM-style file monitors return the full path to the parent # directory that is being watched, relative paths to anything -- cgit v1.2.3-1-g7c22