summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-06-19 11:24:00 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-06-19 11:24:00 -0400
commit869934179f21858b10d4de60d11d3644afcfad74 (patch)
tree071cfc8f44fbb5048404acf2ccec198f11399274 /src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
parente3131034dd00c61ed5ca4f6a38f74250f0ac5726 (diff)
parent16a38827b5bb374da6caaf103f9363a45262f745 (diff)
downloadbcfg2-869934179f21858b10d4de60d11d3644afcfad74.tar.gz
bcfg2-869934179f21858b10d4de60d11d3644afcfad74.tar.bz2
bcfg2-869934179f21858b10d4de60d11d3644afcfad74.zip
merged maint
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Yum.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Yum.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
index ddc1aa0f9..87909dc4c 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Yum.py
@@ -4,14 +4,13 @@ import time
import copy
import glob
import socket
-import random
import logging
import threading
import lxml.etree
from UserDict import DictMixin
from subprocess import Popen, PIPE, STDOUT
import Bcfg2.Server.Plugin
-from Bcfg2.Bcfg2Py3k import StringIO, cPickle, HTTPError, ConfigParser, file
+from Bcfg2.Bcfg2Py3k import StringIO, cPickle, HTTPError, URLError, ConfigParser, file
from Bcfg2.Server.Plugins.Packages.Collection import Collection
from Bcfg2.Server.Plugins.Packages.Source import SourceInitError, Source, \
fetch_url
@@ -200,6 +199,13 @@ class YumCollection(Collection):
config.set(reponame, "includepkgs",
" ".join(source.whitelist))
+ if raw:
+ opts = source.server_options
+ else:
+ opts = source.client_options
+ for opt, val in opts.items():
+ config.set(reponame, opt, val)
+
if raw:
return config
else:
@@ -560,6 +566,11 @@ class YumSource(Source):
except ValueError:
self.logger.error("Packages: Bad url string %s" % rmdurl)
return []
+ except URLError:
+ err = sys.exc_info()[1]
+ self.logger.error("Packages: Failed to fetch url %s. %s" %
+ (rmdurl, err))
+ return []
except HTTPError:
err = sys.exc_info()[1]
self.logger.error("Packages: Failed to fetch url %s. code=%s" %