summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-05-29 15:26:03 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-05-29 15:26:03 +0000
commitffff02894d23210fb8d60f85cbdb33ada5b26859 (patch)
tree0a0a9fbf893664ac32b8d546e00b8787343b5b84 /src/lib
parent4376e48cd2e346a1726a82b08d6811c6d4ed0608 (diff)
downloadbcfg2-ffff02894d23210fb8d60f85cbdb33ada5b26859.tar.gz
bcfg2-ffff02894d23210fb8d60f85cbdb33ada5b26859.tar.bz2
bcfg2-ffff02894d23210fb8d60f85cbdb33ada5b26859.zip
Packages: Fix traceback with missing config.xml (Reported by Jack Neely)
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5262 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-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 0c7544415..01e25c96f 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -312,7 +312,12 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
if not os.path.exists(cachepath):
# create cache directory if needed
os.makedirs(cachepath)
- xdata = lxml.etree.parse(self.data + '/config.xml').getroot()
+ try:
+ xdata = lxml.etree.parse(self.data + '/config.xml').getroot()
+ except IOError, e:
+ print("Failed to read Packages configuration. Have you"
+ " created your config.xml file?")
+ raise Bcfg2.Server.Plugin.PluginInitError
self.sources = []
for s in xdata.findall('APTSource'):
self.sources.append(APTSource(cachepath, **source_from_xml(s)))