summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Tools/POSIX
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-12-05 14:47:52 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-12-05 14:47:52 -0500
commitc425991254dd11163455882fb8aaf918c9274c10 (patch)
tree0a8be771574ce4216f1b2dd9df8ae96fdf31f818 /src/lib/Bcfg2/Client/Tools/POSIX
parent96f1e72d5da30bb4d3c9b63cff010c8048d9e51d (diff)
downloadbcfg2-c425991254dd11163455882fb8aaf918c9274c10.tar.gz
bcfg2-c425991254dd11163455882fb8aaf918c9274c10.tar.bz2
bcfg2-c425991254dd11163455882fb8aaf918c9274c10.zip
POSIX: skip loading POSIX sub-tools that raise ImportError
This mimics the behavior for "real" tools
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools/POSIX')
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py b/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py
index 7708c4f72..8d64cf84d 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/__init__.py
@@ -47,8 +47,11 @@ class POSIX(Bcfg2.Client.Tools.Tool):
mname = submodule[1].rsplit('.', 1)[-1]
if mname == 'base':
continue
- module = getattr(__import__(submodule[1]).Client.Tools.POSIX,
- mname)
+ try:
+ module = getattr(__import__(submodule[1]).Client.Tools.POSIX,
+ mname)
+ except ImportError:
+ continue
hdlr = getattr(module, "POSIX" + mname)
if POSIXTool in hdlr.__mro__:
# figure out what entry type this handler handles