diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-05-30 12:34:28 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-05-30 12:34:28 -0400 |
commit | 4957350195eb06b53fb9c8b7be81be90366ee596 (patch) | |
tree | 76088577a9ad3e81c44359ef9164baec88cf47ac | |
parent | b38dfee242e2b02082cde8f44f6af87a1a243620 (diff) | |
download | third_party-cobbler-4957350195eb06b53fb9c8b7be81be90366ee596.tar.gz third_party-cobbler-4957350195eb06b53fb9c8b7be81be90366ee596.tar.xz third_party-cobbler-4957350195eb06b53fb9c8b7be81be90366ee596.zip |
No longer cashing snippets as we want things to be very dynamic.
-rw-r--r-- | cobbler/templar.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/cobbler/templar.py b/cobbler/templar.py index fa401b8..b41b471 100644 --- a/cobbler/templar.py +++ b/cobbler/templar.py @@ -30,7 +30,6 @@ class Templar: self.config = config self.api = config.api self.settings = config.settings() - self.cache = {} def render(self, data_input, search_table, out_path, subject=None): """ @@ -176,14 +175,22 @@ class Templar: if filename is None: return "# error: no snippet data found" - # potentially eliminate a ton of system calls if syncing - # thousands of systems that use the same template - if self.cache.has_key(filename): - return self.cache[filename] + # disabling this as it requires restarting cobblerd after + # making changes to snippets. not good. Since kickstart + # templates are now generated dynamically and we don't need + # to load all snippets to parse any given template, this should + # be ok, leaving this in as a footnote should we need it later. + # + ## potentially eliminate a ton of system calls if syncing + ## thousands of systems that use the same template + #if self.cache.has_key(filename): + # + # return self.cache[filename] fd = open(filename,"r") data = fd.read() - self.cache[filename] = data + # self.cache[filename] = data fd.close() return data + |