[et-mgmt-tools] python-cheetah templating not working for config.repo?

Michael DeHaan mdehaan at redhat.com
Mon Oct 8 14:41:00 UTC 2007


Shimizu Kuniaki wrote:
> Hi,
>
> I found repository settings when importing distribution might have
> some troubles.
>
> After importing distribution using "cobbler import", config.repo file
> is generated, but it seems python-cheetah templating doesn't work for
> "@@server@@" in config.repo file.

Good catch, thanks!

This file doesn't go through the templating engine.  It probably should.

Here's the patch, which I've also checked in to git:

--- a/cobbler/action_reposync.py
+++ b/cobbler/action_reposync.py
@@ -224,9 +224,12 @@ class RepoSync:
         config_file.write("[%s]\n" % repo.name)
         config_file.write("name=%s\n" % repo.name)
         if output:
-            
config_file.write("baseurl=http://%s/cobbler/repo_mirror/%s\n" % 
(self.setting
+            line = "baseurl=http://%s/cobbler/repo_mirror/%s\n" % 
(self.settings.server, r
+            config_file.write(line)
         else:
-            config_file.write("baseurl=%s\n" % repo.mirror)
+            line = "baseurl=%s\n" % repo.mirror
+            line = line.replace("@@server@@",self.settings.server)




More information about the et-mgmt-tools mailing list