summaryrefslogtreecommitdiffstats
path: root/src
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 10:55:36 -0400
commitd1877090ad7c971140fcc25e3490e307fe8f7a49 (patch)
tree696f8b23fba01fb740279f195dd1dbdb2da1b10b /src
parent3c609ebeea41e1972971af1cedda58f2f6d12a6d (diff)
downloadbcfg2-d1877090ad7c971140fcc25e3490e307fe8f7a49.tar.gz
bcfg2-d1877090ad7c971140fcc25e3490e307fe8f7a49.tar.bz2
bcfg2-d1877090ad7c971140fcc25e3490e307fe8f7a49.zip
fixed repo name generation
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Source.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
index a7c246940..f005d41ec 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
+++ b/src/lib/Bcfg2/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):
@@ -136,7 +136,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:
@@ -146,6 +146,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