summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Packages
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-02-06 14:29:51 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-02-06 14:29:51 -0500
commit8d9fb29a5d8db6bcb9cee8d1a78de3274541534b (patch)
tree06a089021b6c6bc32cc474cfee31d99cfb464746 /src/lib/Server/Plugins/Packages
parent4b8bdacc8f00d13e1ee4746ea54de2c8d35d10ae (diff)
downloadbcfg2-8d9fb29a5d8db6bcb9cee8d1a78de3274541534b.tar.gz
bcfg2-8d9fb29a5d8db6bcb9cee8d1a78de3274541534b.tar.bz2
bcfg2-8d9fb29a5d8db6bcb9cee8d1a78de3274541534b.zip
catch error if Packages plugin lacks permissions to create cachedir
Diffstat (limited to 'src/lib/Server/Plugins/Packages')
-rw-r--r--src/lib/Server/Plugins/Packages/PackagesSources.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Packages/PackagesSources.py b/src/lib/Server/Plugins/Packages/PackagesSources.py
index 35759879d..da79c00e9 100644
--- a/src/lib/Server/Plugins/Packages/PackagesSources.py
+++ b/src/lib/Server/Plugins/Packages/PackagesSources.py
@@ -27,7 +27,12 @@ class PackagesSources(Bcfg2.Server.Plugin.SingleXMLFileBacked,
self.config = config
if not os.path.exists(self.cachepath):
# create cache directory if needed
- os.makedirs(self.cachepath)
+ try:
+ os.makedirs(self.cachepath)
+ except OSError:
+ err = sys.exc_info()[1]
+ self.logger.error("Could not create Packages cache at %s: %s" %
+ (self.cachepath, err))
self.pkg_obj = packages
self.parsed = set()
self.loaded = False