summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Reporting/Transport/__init__.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 10:32:04 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 10:41:53 -0400
commit7e43d4af98a12e5685f250bf2161fc7afebe02a1 (patch)
treec01973d3dcf075b394c7dec66a1a45894d8c9f4d /src/lib/Bcfg2/Reporting/Transport/__init__.py
parent4261f7238e3b7eb169fcb0f672e7fdb86d722189 (diff)
downloadbcfg2-7e43d4af98a12e5685f250bf2161fc7afebe02a1.tar.gz
bcfg2-7e43d4af98a12e5685f250bf2161fc7afebe02a1.tar.bz2
bcfg2-7e43d4af98a12e5685f250bf2161fc7afebe02a1.zip
Options: migrated reporting to new parser
Diffstat (limited to 'src/lib/Bcfg2/Reporting/Transport/__init__.py')
-rw-r--r--src/lib/Bcfg2/Reporting/Transport/__init__.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/lib/Bcfg2/Reporting/Transport/__init__.py b/src/lib/Bcfg2/Reporting/Transport/__init__.py
index 73bdd0b3a..04b574ed7 100644
--- a/src/lib/Bcfg2/Reporting/Transport/__init__.py
+++ b/src/lib/Bcfg2/Reporting/Transport/__init__.py
@@ -1,35 +1,3 @@
"""
Public transport routines
"""
-
-import sys
-from Bcfg2.Reporting.Transport.base import TransportError, \
- TransportImportError
-
-
-def load_transport(transport_name, setup):
- """
- Try to load the transport. Raise TransportImportError on failure
- """
- try:
- mod_name = "%s.%s" % (__name__, transport_name)
- mod = getattr(__import__(mod_name).Reporting.Transport, transport_name)
- except ImportError:
- try:
- mod = __import__(transport_name)
- except:
- raise TransportImportError("Error importing transport %s: %s" %
- (transport_name, sys.exc_info()[1]))
- try:
- return getattr(mod, transport_name)(setup)
- except:
- raise TransportImportError("Error instantiating transport %s: %s" %
- (transport_name, sys.exc_info()[1]))
-
-
-def load_transport_from_config(setup):
- """Load the transport in the config... eventually"""
- try:
- return load_transport(setup['reporting_transport'], setup)
- except KeyError:
- raise TransportImportError('Transport missing in config')