cobbler/SOURCES/cobbler-unicode-scripts.patch

30 lines
1.3 KiB
Diff

diff -rupN cobbler-2.0.7.old/cobbler/templar.py cobbler-2.0.7/cobbler/templar.py
--- cobbler-2.0.7.old/cobbler/templar.py 2015-05-06 14:47:57.858206601 -0400
+++ cobbler-2.0.7/cobbler/templar.py 2015-05-06 14:54:56.002214099 -0400
@@ -108,6 +108,9 @@ class Templar:
# tell Cheetah not to blow up if it can't find a symbol for something
raw_data = "#errorCatcher ListErrors\n" + raw_data
+ # specify unicode encoding for Cheetah Compiler
+ raw_data = "#unicode UTF-8\n" + raw_data
+
table_copy = search_table.copy()
# for various reasons we may want to call a module inside a template and pass
diff -rupN cobbler-2.0.7.old/cobbler/template_api.py cobbler-2.0.7/cobbler/template_api.py
--- cobbler-2.0.7.old/cobbler/template_api.py 2015-05-06 14:47:57.860206615 -0400
+++ cobbler-2.0.7/cobbler/template_api.py 2015-05-06 14:59:50.250384146 -0400
@@ -311,8 +311,9 @@ class Template(BuiltinTemplate, MacrosTe
pass
try:
- return utils.read_file_contents('%s/%s' % (self.getVar('snippetsdir'),
- file), fetch_if_remote=True)
+ return "#unicode UTF-8\n" + utils.read_file_contents(
+ '%s/%s' % (self.getVar('snippetsdir'), file),
+ fetch_if_remote=True)
except FileNotFoundException:
return None