summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-04 10:55:36 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-04 11:13:43 -0400
commit7f64eae09fc93c37aaf90c511e7db5a56f0ba08a (patch)
treeeb6a8f668c06fcebc0528845f193545521757309
parent78c498c48687feeaf19a6cdca18cc266aa17130f (diff)
downloadbcfg2-7f64eae09fc93c37aaf90c511e7db5a56f0ba08a.tar.gz
bcfg2-7f64eae09fc93c37aaf90c511e7db5a56f0ba08a.tar.bz2
bcfg2-7f64eae09fc93c37aaf90c511e7db5a56f0ba08a.zip
fixed repo name generation
-rw-r--r--src/lib/Server/Plugins/Packages/Source.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Packages/Source.py b/src/lib/Server/Plugins/Packages/Source.py
index f13267da1..5b0aa4213 100644
--- a/src/lib/Server/Plugins/Packages/Source.py
+++ b/src/lib/Server/Plugins/Packages/Source.py
@@ -33,7 +33,7 @@ class SourceInitError(Exception):
class Source(Bcfg2.Server.Plugin.Debuggable):
mrepo_re = re.compile(r'/RPMS\.([^/]+)')
pulprepo_re = re.compile(r'pulp/repos/([^/]+)')
- genericrepo_re = re.compile(r'https?://[^/]+/(.+?)/?$')
+ genericrepo_re = re.compile('https?://.*?/([^/]+)/?$')
basegroups = []
def __init__(self, basepath, xsource, config):
@@ -135,7 +135,7 @@ class Source(Bcfg2.Server.Plugin.Debuggable):
def get_repo_name(self, url_map):
# try to find a sensible name for a repo
- if url_map['components']:
+ if 'components' in url_map and url_map['components']:
# use the first component as the name
rname = url_map['components'][0]
else:
@@ -145,6 +145,7 @@ class Source(Bcfg2.Server.Plugin.Debuggable):
self.genericrepo_re):
match = repo_re.search(url_map['url'])
if match:
+ name = match.group(1)
break
if name is None:
# couldn't figure out the name from the URL or URL map