Hi Guys,

Thanks for the quick responses!

Firstly, just to confirm that this affects *all* snippets that are
used per_profile (I used a blank one as an example to show there was
no parse error in the actual snippet. This includes snippets with 0
length, snippets with just a comment in them and 'normal' snippets.)

Secondly, i'm afraid that Michaels two patches do not fix this.

To reproduce the problem, install the epel testing RPM on a clean
install of CentOS 5.3, create a kickstart file that includes a snippet
and create that snippet in the per_profile directory. I've done it on
a second clean install.

The difference that the first patch makes is as follows:

Old error (data_out = str(t))

[r...@cobbler partition]# cobbler system getks --name=test

# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message goes
# away or changes.
#
#
# module.__init__() argument 1 must be string, not unicode
#   File "/usr/lib/python2.4/site-packages/cobbler/templar.py", line
115, in render
#     data_out = str(t)
#
#   File "/usr/lib64/python2.4/site-packages/Cheetah/Template.py",
line 982, in __str__
#     def __str__(self): return getattr(self, mainMethName)()
#
#   File "cheetah_DynamicallyCompiledCheetahTemplate_1241216798_86_94239.py",
line 174, in respond
#
#   File "cheetah_DynamicallyCompiledCheetahTemplate_1241216798_86_94239.py",
line 92, in __errorCatcher4
#
#   File "<string>", line 0, in ?
#
#   File "/usr/lib/python2.4/site-packages/cobbler/template_api.py",
line 156, in SNIPPET
#     result = BuiltinTemplate.SNIPPET(self, file)
#
#   File "DynamicallyCompiledCheetahTemplate.py", line 89, in SNIPPET
#
#   File "/usr/lib64/python2.4/site-packages/Cheetah/Template.py",
line 1512, in _handleCheetahInclude
#     nestedTemplateClass = compiler.compile(source=source,file=file)
#
#   File "/usr/lib/python2.4/site-packages/cobbler/template_api.py",
line 124, in compile
#     return Cheetah.Template.Template.compile(*args, **kwargs)
#
#   File "/usr/lib64/python2.4/site-packages/Cheetah/Template.py",
line 754, in compile
#     mod = new.module(uniqueModuleName)
#

New patch (data_out = t.respond())

[r...@cobbler partition]# cobbler system getks --name=test

# *** ERROR ***
#
# There is a templating error preventing this file from rendering correctly.
#
# This is most likely not due to a bug in Cobbler and is something you can fix.
#
# Look at the message below to see what things are causing problems.
#
# (1) Does the template file reference a $variable that is not defined?
# (2) is there a formatting error in a Cheetah directive?
# (3) Should dollar signs ($) be escaped that are not being escaped?
#
# Try fixing the problem and then investigate to see if this message goes
# away or changes.
#
#
# module.__init__() argument 1 must be string, not unicode
#   File "/usr/lib/python2.4/site-packages/cobbler/templar.py", line
116, in render
#     data_out = t.respond()
#
#   File "cheetah_DynamicallyCompiledCheetahTemplate_1241216747_29_15519.py",
line 174, in respond
#
#   File "cheetah_DynamicallyCompiledCheetahTemplate_1241216747_29_15519.py",
line 92, in __errorCatcher4
#
#   File "<string>", line 0, in ?
#
#   File "/usr/lib/python2.4/site-packages/cobbler/template_api.py",
line 156, in SNIPPET
#     result = BuiltinTemplate.SNIPPET(self, file)
#
#   File "DynamicallyCompiledCheetahTemplate.py", line 89, in SNIPPET
#
#   File "/usr/lib64/python2.4/site-packages/Cheetah/Template.py",
line 1512, in _handleCheetahInclude
#     nestedTemplateClass = compiler.compile(source=source,file=file)
#
#   File "/usr/lib/python2.4/site-packages/cobbler/template_api.py",
line 124, in compile
#     return Cheetah.Template.Template.compile(*args, **kwargs)
#
#   File "/usr/lib64/python2.4/site-packages/Cheetah/Template.py",
line 754, in compile
#     mod = new.module(uniqueModuleName)
#

I'm happy to do anything to help - is there anything useful I can send
you? (If you want I can put send you a gzipped xen VM with the
problematic cobbler install, if you can download ~10G of data!)

Many thanks,

Alex







On Fri, May 1, 2009 at 5:03 PM, Michael DeHaan <[email protected]> wrote:
> Jasper Capel wrote:
>> On 05/01/2009 04:16 PM, Michael DeHaan wrote:
>>
>>> You have to remove both U's. This was a problem in 1.6.2, that is fixed
>>> in 1.6.3.
>>>
>>> --Michael
>>>
>>>
>>
>> One isn't actually in the JSON file:
>>
>> # cobbler profile report openvpn
>> profile              : openvpn
>> parent               : CentOS-5.2-xen-x86_64
>> comment              :
>> created              : Tue Jan 27 15:42:26 2009
>> dhcp tag             : <<inherit>>
>> enable menu          : True
>> kernel options       : {}
>> kickstart            : <<inherit>>
>> ks metadata          : {}
>> mgmt classes         : [u'openvpn', u'postfix']
>> modified             : Fri Feb 27 13:25:06 2009
>> name servers         : [u'172.18.1.100']
>> name servers search  : []
>> owners               : [u'admin']
>> post kernel options  : {}
>> redhat mgmt key      : <<inherit>>
>> redhat mgmt server   : <<inherit>>
>> repos                : ['uCentOS-5-Base-x86_64',
>> 'uCentOS-5-Extras-x86_64', 'uCentOS-5-Updates-x86_64',
>> 'uEL-5-x86_64-ATRPMS', 'uEL-5-x86_64-EPEL', 'uEL-5-x86_64-EPEL-testing']
>> server               : <<inherit>>
>> template_files       : {}
>> virt bridge          : <<inherit>>
>> virt cpus            : <<inherit>>
>> virt file size       : <<inherit>>
>> virt path            : <<inherit>>
>> virt ram             : <<inherit>>
>> virt type            : auto
>>
>>
>>
>> # cat /var/lib/cobbler/config/profiles.d/openvpn.json
>> {"comment": "", "kickstart": "<<inherit>>", "name_servers_search": [],
>> "ks_meta": {}, "kernel_options_post": {}, "repos":
>> ["CentOS-5-Base-x86_64", "CentOS-5-Extras-x86_64",
>> "CentOS-5-Updates-x86_64", "EL-5-x86_64-ATRPMS", "EL-5-x86_64-EPEL",
>> "EL-5-x86_64-EPEL-testing"], "redhat_management_key": "<<inherit>>",
>> "virt_path": "<<inherit>>", "kernel_options": {}, "name_servers":
>> ["172.18.1.100"], "mtime": 1235737506.2022941, "template_files": {},
>> "id": "MTIzMDAyMTgyNC4zMjM4NTM5NjguMjY4Nzk", "virt_cpus": "<<inherit>>",
>> "mgmt_classes": ["openvpn", "postfix"], "distro": "<<inherit>>",
>> "virt_bridge": "<<inherit>>", "parent": "CentOS-5.2-xen-x86_64",
>> "virt_type": "auto", "enable_menu": true, "virt_file_size":
>> "<<inherit>>", "ctime": 1233067346.48,"dhcp_tag": "<<inherit>>",
>> "owners": ["admin"], "name": "openvpn", "virt_ram": "<<inherit>>",
>> "random_id": "6KRI", "server": "<<inherit>>",
>> "redhat_management_server": "<<inherit>>", "depth": 2}
>>
>> -Jasper
>> _______________________________________________
>> cobbler mailing list
>> [email protected]
>> https://fedorahosted.org/mailman/listinfo/cobbler
>>
>
> This seems to fix it for me, let me know if it does not:
>
> *http://tinyurl.com/c8d94p
>
>
> *
> _______________________________________________
> cobbler mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/cobbler
>



-- 
Alex Davies

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender immediately by e-mail and delete this e-mail permanently.
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to