summaryrefslogtreecommitdiffstats
path: root/cobbler/action_import.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-11-05 17:46:04 -0500
committerMichael DeHaan <mdehaan@redhat.com>2007-11-05 17:46:04 -0500
commite17deaeb6f048849ccc8362dc314052b413e4ef6 (patch)
tree19e2359e91e54453cfa2ba1fab0fdc4b789d5bd7 /cobbler/action_import.py
parent7b0c3398210aeee9cfc2979b684d34dadd569444 (diff)
downloadthird_party-cobbler-e17deaeb6f048849ccc8362dc314052b413e4ef6.tar.gz
third_party-cobbler-e17deaeb6f048849ccc8362dc314052b413e4ef6.tar.xz
third_party-cobbler-e17deaeb6f048849ccc8362dc314052b413e4ef6.zip
Changes to make the overhauled repo templating work with source repositories (which are repos found on the installation media during the import process, things like RHEL5's VT repo).
Diffstat (limited to 'cobbler/action_import.py')
-rw-r--r--cobbler/action_import.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index d2ccb64..9bf18ba 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -409,25 +409,21 @@ class Importer:
fname = os.path.join(self.settings.webdir, "ks_mirror", "config", "%s-%s.repo" % (distro.name, counter))
- # NOTE: as these are not processed as templates during sync, the URLs do not move
- # if the server variable is changed and re-synced (i.e. if using the boot server as
- # a laptop). This will only affect EL5+ repos with yum_core_mirror_from_server enabled
- # when running from a laptop that has a non-constant IP/hostname. Relatively minor but
- # a notable FYI should this cause problems. The actual fix (moving some of this to sync)
- # is somewhat involved. Basically this is why self.settings.server is used and not
- # @@server@@.
-
repo_url = "http://%s/cobbler/ks_mirror/config/%s-%s.repo" % (self.settings.server, distro.name, counter)
repo_url2 = "http://%s/cobbler/ks_mirror/%s" % (self.settings.server, urlseg)
distro.source_repos.append([repo_url,repo_url2])
+ # NOTE: the following file is now a Cheetah template, so it can be remapped
+ # during sync, that's why we have the @@server@@ left as templating magic.
+ # repo_url2 is actually no longer used. (?)
+
print _("- url: %s") % repo_url
config_file = open(fname, "w+")
- config_file.write("[%s]\n" % "core-%s" % counter)
- config_file.write("name=%s\n" % "core-%s " % counter)
- config_file.write("baseurl=http://%s/cobbler/ks_mirror/%s\n" % (self.settings.server,urlseg))
+ config_file.write("[core-%s]\n" % counter)
+ config_file.write("name=core-%s\n" % counter)
+ config_file.write("baseurl=http://@@server@@/cobbler/ks_mirror/%s\n" % (urlseg))
config_file.write("enabled=1\n")
config_file.write("gpgcheck=0\n")
config_file.close()