Nicholas George wrote:
> Hi,
>
> I'm running Cobbler 1.4.2-1.el5 with Python Cheetah 2.0.1-1.el5 on
> Centos 5.
>
> I'm trying to use the prescribed method for testing for variable
> existence within some of my snippets.
>
> e.g
> #if $varname
> #else
> #end if
I think you want:
#if $getVar('varname','') != ''
do something with $varname
#else
you can't use varname
#end if
>
> The problem is, when I use the above code, Cobbler will no longer
> expand the snippet into the resulting kickstart file.
>
> For example, if I grab the expanded kickstart file (wget
> http://localhost/cblr/svc/op/ks/system/XXX) and look inside the
> kickstart file, I see the following text where the expanded snippet
> should be.
>
> $SNIPPET('snippet name')
>
> This problem only occurs if the variable does NOT exist. If the
> variable DOES exist, the snippet is expanded into the kickstart file
> as expected (including the section that is encompassed in the #if
> statement). This problem could be a Cheetah issue, but I'm not sure.
>
> Any ideas on how to get around this issue?
>
> Regards,
> Nick George
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> cobbler mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/cobbler
>
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler