summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-08-26 21:28:11 +0000
committerSol Jerome <sol.jerome@gmail.com>2010-08-27 08:28:39 -0500
commitd84167e06dd4d607e86a0f5599d95eee331ce907 (patch)
tree59f3b9a87a1a56339a9b0763214e43c24ad25f90 /src
parent14a581212c1dbb0107cca8c65011925044c0a2fa (diff)
downloadbcfg2-d84167e06dd4d607e86a0f5599d95eee331ce907.tar.gz
bcfg2-d84167e06dd4d607e86a0f5599d95eee331ce907.tar.bz2
bcfg2-d84167e06dd4d607e86a0f5599d95eee331ce907.zip
Tools/__init__.py: Autoload client tools present in the Tools directory
Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6037 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Tools/__init__.py35
1 files changed, 9 insertions, 26 deletions
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py
index 59f66612d..1216fb60a 100644
--- a/src/lib/Client/Tools/__init__.py
+++ b/src/lib/Client/Tools/__init__.py
@@ -1,30 +1,4 @@
"""This contains all Bcfg2 Tool modules"""
-__revision__ = '$Revision$'
-
-__all__ = ["Action",
- "APT",
- "Blast",
- "Chkconfig",
- "DebInit",
- "Encap",
- "IPS",
- "FreeBSDInit",
- "FreeBSDPackage",
- "launchd",
- "MacPorts",
- "Portage",
- "POSIX",
- "RPMng",
- "rpmtools",
- "RcUpdate",
- "SMF",
- "SYSV",
- "Upstart",
- "YUMng"]
-
-drivers = [item for item in __all__ if item not in ['rpmtools']]
-default = [item for item in drivers if item not in ['RPM', 'Yum']]
-
# suppress popen2 warnings for python 2.3
import warnings
warnings.filterwarnings("ignore", "The popen2 module is deprecated.*",
@@ -36,6 +10,15 @@ import sys
import time
import Bcfg2.Client.XML
+__revision__ = '$Revision$'
+
+__all__ = [tool.split('.')[0] \
+ for tool in os.listdir(os.path.dirname(__file__)) \
+ if tool.endswith(".py") and tool != "__init__.py"]
+
+drivers = [item for item in __all__ if item not in ['rpmtools']]
+default = [item for item in drivers if item not in ['RPM', 'Yum']]
+
class toolInstantiationError(Exception):
"""This error is called if the toolset cannot be instantiated."""