summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-07-30 12:19:26 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-07-30 12:19:31 -0400
commit233a0b7555e34ee09e4429a9496ba8aa2a5a482f (patch)
treeef0682dda78b3386cac90b84c6f90c6c88543d1b /src/lib/Bcfg2/Server/Plugins/Packages/Source.py
parentb476aabce0097d9e4ef81182de5dc30025edceb1 (diff)
downloadbcfg2-233a0b7555e34ee09e4429a9496ba8aa2a5a482f.tar.gz
bcfg2-233a0b7555e34ee09e4429a9496ba8aa2a5a482f.tar.bz2
bcfg2-233a0b7555e34ee09e4429a9496ba8aa2a5a482f.zip
fixed repo names for sources that apply globally to all clients (#1120)
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Source.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Source.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
index 332d0c488..8775dec5a 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
@@ -159,10 +159,15 @@ class Source(Bcfg2.Server.Plugin.Debuggable):
if match:
name = match.group(1)
break
- if name is not None:
+ if name and self.groups:
rname = "%s-%s" % (self.groups[0], name)
- else:
+ elif self.groups:
rname = self.groups[0]
+ else:
+ # a global source with no reasonable name. just use
+ # the full url and let the regex below make it even
+ # uglier.
+ rname = url_map['url']
# see yum/__init__.py in the yum source, lines 441-449, for
# the source of this regex. yum doesn't like anything but
# string.ascii_letters, string.digits, and [-_.:]. There