summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-09-12 08:23:20 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-09-12 08:23:20 -0500
commit49e51224e3b7637c516ad11391e0e382a158d501 (patch)
treea1e531461e83d7ee61e6b1028f5caeb76f001acc /src/lib/Server/Plugins
parenta2ab89bd17cbc1565593dc976a8d590b1e88f2d1 (diff)
downloadbcfg2-49e51224e3b7637c516ad11391e0e382a158d501.tar.gz
bcfg2-49e51224e3b7637c516ad11391e0e382a158d501.tar.bz2
bcfg2-49e51224e3b7637c516ad11391e0e382a158d501.zip
Packages: Fix traceback when sources.xml is missing (#1043)
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Server/Plugins')
-rw-r--r--src/lib/Server/Plugins/Packages.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index 155b78581..bc419773a 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -731,7 +731,12 @@ class PACSource(Source):
class PackagesSources(Bcfg2.Server.Plugin.SingleXMLFileBacked,
Bcfg2.Server.Plugin.StructFile):
def __init__(self, filename, cachepath, fam, packages):
- Bcfg2.Server.Plugin.SingleXMLFileBacked.__init__(self, filename, fam)
+ try:
+ Bcfg2.Server.Plugin.SingleXMLFileBacked.__init__(self, filename, fam)
+ except OSError:
+ err = sys.exc_info()[1]
+ logger.error("Packages: Error processing sources: %s" % err)
+ raise Bcfg2.Server.Plugin.PluginInitError
Bcfg2.Server.Plugin.StructFile.__init__(self, filename)
self.cachepath = cachepath
if not os.path.exists(self.cachepath):