Scott Henson <shenson(a)redhat.com> wrote:
On Wed, 02 Mar 2011 00:15:01 -0800, petermity
<6t12-n6js(a)dea.spamcon.org> wrote:
> How can I force a failure on a bad condition, so that "cobbler
> profile getks" fails with a traceback (and the actual kickstart
> fails, and validateks fails too)?
>
> For instance, I don't want to proceed if some variable is not set:
>
> #if $getVar('myvar','') != ''
> # ... do something with $myvar
> #else
> # Somehow throw an error to abort, e.g.:
> #error "The profile must define 'myvar'"
> #end if
I believe the directives you need are #assert and #raise. Though they
are probably disabled by safe templating. I'll include one of them in
the next release of cobbler (along with the ability to modify the
whitelist in the settings file).
To help track this, I submitted an enhacement issue:
https://fedorahosted.org/cobbler/ticket/656