diff options
author | anatoly techtonik <techtonik@gmail.com> | 2011-09-12 23:09:04 +0300 |
---|---|---|
committer | anatoly techtonik <techtonik@gmail.com> | 2011-09-12 23:09:04 +0300 |
commit | 99c786033f720bd904a4fb61e99ec574d0180dd1 (patch) | |
tree | d37204aba395a3e99cb1a854a90ac169f4bab2fc /src/lib/Server/Plugins | |
parent | d9341a570b76393034c292b16273e528bd41d0e1 (diff) | |
download | bcfg2-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.py | 5 |
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 |