help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: undefined variable test


From: Mark Burgess
Subject: Re: undefined variable test
Date: Tue, 14 Jan 2003 07:51:53 +0100 (MET)

> 
> I've just been messing with it - IsDefined() - like so:
> 
> groups:
>   have_myvar = ( IsDefined(myvar) )
> 
> shellcommands:
>   have_myvar::
>   "/bin/echo myvar is $(myvar)"
> 
> I had been hoping to use it to get default values for variables like this:
> 
> control:
>   !IsDefined(basedir)::
>   basedir = ( /opt )
> 
> Alas, it appears you can only use IsDefined() in groups definitions and
> those are evaluated after the control section. I could probably work around
> it with imports but that is nasty. Any chance of widening the availability
> of IsDefined() Mark?


Groups are not evaluated after control, unless you place them after control
in your script.

M

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]