diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2012-07-30 16:08:59 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2012-07-30 16:08:59 -0500 |
commit | 211864073d9254f9d116ee052092f1949775f544 (patch) | |
tree | 05c7ac982f2b89551fc92f2ab4b7482b516f9829 /src/lib/Bcfg2 | |
parent | f9b6982372833351ea430c10e286d7c7f050ddff (diff) | |
download | bcfg2-211864073d9254f9d116ee052092f1949775f544.tar.gz bcfg2-211864073d9254f9d116ee052092f1949775f544.tar.bz2 bcfg2-211864073d9254f9d116ee052092f1949775f544.zip |
Inotify: Use functools where reduce is unavailable
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Bcfg2')
-rw-r--r-- | src/lib/Bcfg2/Bcfg2Py3k.py | 6 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/FileMonitor/Inotify.py | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Bcfg2Py3k.py b/src/lib/Bcfg2/Bcfg2Py3k.py index 30feaf8c5..3dc6fc6f0 100644 --- a/src/lib/Bcfg2/Bcfg2Py3k.py +++ b/src/lib/Bcfg2/Bcfg2Py3k.py @@ -82,6 +82,12 @@ try: except: input = input +try: + reduce = reduce +except NameError: + import functools + reduce = functools.reduce + if sys.hexversion >= 0x03000000: from io import FileIO as file else: diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py index 7362432b8..880ac7e8d 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py @@ -1,10 +1,11 @@ """ Inotify driver for file alteration events """ -import os -import sys import logging import operator +import os import pyinotify +import sys +from Bcfg2.Bcfg2Py3k import reduce from Bcfg2.Server.FileMonitor import Event from Bcfg2.Server.FileMonitor.Pseudo import Pseudo |