diff options
author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-04-04 13:10:16 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-04-04 13:10:16 -0400 |
commit | 5109a32f333c9aceb978e1dd2887191ee1f9fdf6 (patch) | |
tree | a487b5546518c363b3c44fb2ace473537bb0b04c /cobbler | |
parent | 201120155d0a045fe1af77725c40e8f380b6182d (diff) | |
download | cobbler-5109a32f333c9aceb978e1dd2887191ee1f9fdf6.tar.gz cobbler-5109a32f333c9aceb978e1dd2887191ee1f9fdf6.tar.xz cobbler-5109a32f333c9aceb978e1dd2887191ee1f9fdf6.zip |
More better (TM) repo parameterization in kickstarts.
Diffstat (limited to 'cobbler')
-rw-r--r-- | cobbler/action_import.py | 5 | ||||
-rw-r--r-- | cobbler/action_sync.py | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py index 669c2f12..1f35b444 100644 --- a/cobbler/action_import.py +++ b/cobbler/action_import.py @@ -308,7 +308,10 @@ class Importer: fname = os.path.join(self.settings.webdir, "ks_mirror", "config", "%s-%s.repo" % (distro.name, counter)) repo_url = "http://%s/cobbler/ks_mirror/config/%s-%s.repo" % (self.settings.server, distro.name, counter) - distro.source_repos.append(repo_url) + + repo_url2 = "http://%s/cobbler/ks_mirror/%s" % (self.settings.server, urlseg) + + distro.source_repos.append([repo_url,repo_url2]) print "- url: %s" % repo_url config_file = open(fname, "w+") diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index a00d82f9..4203da81 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -396,8 +396,8 @@ class BootSync: # if there is only one, then there is no need to do this. if len(distro.source_repos) > 1: for r in distro.source_repos: - base = r.split("/")[-1].replace(".repo","") - buf = buf + "repo --name=%s --baseurl=%s\n" % (base, r) + base = r[1].split("/")[-1].replace(".repo","") + buf = buf + "repo --name=%s --baseurl=%s\n" % (base, r[1]) return buf @@ -409,14 +409,15 @@ class BootSync: repo = self.repos.find(r) if repo is None: continue + repo.local_filename = repo.local_filename.replace(".repo","") if not (repo.local_filename is None) or (repo.local_filename == ""): buf = buf + "wget http://%s/cblr/repo_mirror/%s/config.repo --output-document=/etc/yum.repos.d/%s.repo\n" % (self.settings.server, repo.name, repo.local_filename) # now install the core repos distro = self.distros.find(profile.distro) for r in distro.source_repos: - short = r.split("/")[-1] - buf = buf + "wget %s --output-document=/etc/yum.repos.d/%s.repo\n" % (r, short) + short = r[0].split("/")[-1] + buf = buf + "wget %s --output-document=/etc/yum.repos.d/%s\n" % (r[0], short) # if there were any core repos, install the voodoo to disable the OS public core # location -- FIXME: should probably run sed on the files, rather than rename them. |