summaryrefslogtreecommitdiffstats
path: root/cobbler/action_sync.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-10-17 16:26:12 -0400
committerJim Meyering <jim@meyering.net>2006-10-17 16:26:12 -0400
commit6e4c8456fe7e11595593a2568c10653dedc287f4 (patch)
tree8736fc6762c3be6182c2027359c8d20625fce527 /cobbler/action_sync.py
parent22586c24c846851b17f9b7050d2c70ca62ab6b51 (diff)
downloadthird_party-cobbler-6e4c8456fe7e11595593a2568c10653dedc287f4.tar.gz
third_party-cobbler-6e4c8456fe7e11595593a2568c10653dedc287f4.tar.xz
third_party-cobbler-6e4c8456fe7e11595593a2568c10653dedc287f4.zip
Removing Cheetah to simplify deps, also don't delete the localmirror on sync (that's bad!).
Diffstat (limited to 'cobbler/action_sync.py')
-rw-r--r--cobbler/action_sync.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index 43f6f15..e1c7de2 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -20,7 +20,6 @@ import time
import yaml # Howell-Clark version
import sub_process
import sys
-from Cheetah.Template import Template
import utils
import cobbler_msg
@@ -143,10 +142,8 @@ class BootSync:
"date" : time.asctime(time.gmtime()),
"next_server" : self.settings.next_server
}
- t = Template(
- "#errorCatcher Echo\n%s" % template_data,
- searchList=[metadata]
- )
+ for x in metadata.keys():
+ template_data = template_data.replace("$%s" % x, metadata[x])
self.tee(f1,str(t))
self.close_file(f1)
@@ -194,7 +191,8 @@ class BootSync:
if os.path.isfile(path):
self.rmfile(path)
if os.path.isdir(path):
- self.rmtree(path)
+ if not x == "localmirror":
+ self.rmtree(path)
# make some directories in /tftpboot
for x in ["pxelinux.cfg","images"]:
@@ -324,16 +322,10 @@ class BootSync:
fd = open(kickstart_input)
data = fd.read()
fd.close()
- data = data.replace("$","@@DOLLAR_SIGN@@")
- data = data.replace("TEMPLATE::","$")
- t = Template(
- "#errorCatcher Echo\n%s" % data,
- searchList=[metadata],
- )
- computed = str(t)
- computed = computed.replace("@@DOLLAR_SIGN@@","$")
+ for x in metadata.keys():
+ data = data.replace("TEMPLATE::%s" % x, metadata[x])
fd = open(out_path, "w+")
- fd.write(computed)
+ fd.write(data)
fd.close()
def build_trees(self):