summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoe Digilio <jdigilio@imca.aps.anl.gov>2011-09-02 11:05:12 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-09-02 12:28:54 -0500
commit1cdc0aaa2982add970cf7ce3cb41bc20860cb7be (patch)
treed854ecbc18e7b27d269e2dddcdac1822635b3c61 /src
parent934c2bc3de5b57f25c4b71ef270f76ffe3d89398 (diff)
downloadbcfg2-1cdc0aaa2982add970cf7ce3cb41bc20860cb7be.tar.gz
bcfg2-1cdc0aaa2982add970cf7ce3cb41bc20860cb7be.tar.bz2
bcfg2-1cdc0aaa2982add970cf7ce3cb41bc20860cb7be.zip
fix traceback when packages.conf doesn't exist or there is no [global]
section. (cherry picked from commit 54e70421bd1aea5bdd495cf48767b88cfe82b3b1)
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/Packages.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index 05c32d82f..155b78581 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -1222,6 +1222,8 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
keydir = self.config.get("global", "gpg_keypath")
except ConfigParser.NoOptionError:
keydir = "/etc/pki/rpm-gpg"
+ except ConfigParser.NoSectionError:
+ keydir = "/etc/pki/rpm-gpg"
remotekey = os.path.join(keydir, os.path.basename(key))
localkey = os.path.join(self.keypath, os.path.basename(key))
kdata = open(localkey).read()