summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins
diff options
context:
space:
mode:
authoranatoly techtonik <techtonik@gmail.com>2011-09-12 23:09:04 +0300
committeranatoly techtonik <techtonik@gmail.com>2011-09-12 23:09:04 +0300
commit99c786033f720bd904a4fb61e99ec574d0180dd1 (patch)
treed37204aba395a3e99cb1a854a90ac169f4bab2fc /src/lib/Server/Plugins
parentd9341a570b76393034c292b16273e528bd41d0e1 (diff)
downloadbcfg2-99c786033f720bd904a4fb61e99ec574d0180dd1.tar.gz
bcfg2-99c786033f720bd904a4fb61e99ec574d0180dd1.tar.bz2
bcfg2-99c786033f720bd904a4fb61e99ec574d0180dd1.zip
Packages: Properly detect when user didn't create sources.xml
Diffstat (limited to 'src/lib/Server/Plugins')
-rw-r--r--src/lib/Server/Plugins/Packages.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index bc419773a..d4d46b9c6 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -735,7 +735,10 @@ class PackagesSources(Bcfg2.Server.Plugin.SingleXMLFileBacked,
Bcfg2.Server.Plugin.SingleXMLFileBacked.__init__(self, filename, fam)
except OSError:
err = sys.exc_info()[1]
- logger.error("Packages: Error processing sources: %s" % err)
+ usermsg = "Packages: Failed to read configuration file %s" % err
+ if not os.path.exists(err):
+ usermsg += " Have you created it?"
+ logger.error(usermsg)
raise Bcfg2.Server.Plugin.PluginInitError
Bcfg2.Server.Plugin.StructFile.__init__(self, filename)
self.cachepath = cachepath