diff options
Diffstat (limited to 'cobbler/action_import.py')
-rw-r--r-- | cobbler/action_import.py | 18 |
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() |