help-cfengine
[Top][All Lists]
Advanced

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

Re: ReturnsZero(): command does not return zero. Is class created with v


From: Mark . Burgess
Subject: Re: ReturnsZero(): command does not return zero. Is class created with value of false?
Date: Wed, 1 Oct 2003 06:25:18 +0200 (MEST)

I'm sorry -- I didn't read this properly first time
around. the problem is a misunderstanding of the ReturnZero()
function. It is the value of the shell returncode that is tested
not the value of the text string printed by the command.
You will need to use StrCmp("0",$returnvar) if you want to test that.
Since fgrep will always succeed if /etc/passwd exists, it will always
return zero in the sense of ReturnZero().

I believe it is explained in the manual that classes are attributes
that are either defined or not. It is certainly implicit in all
of the docs, but whether or not it is clear is of course a matter
of opinion! :)

Mark

On 30 Sep, Hans Deragon wrote:
> Mark.Burgess@iu.hio.no wrote:
>> !class is true if class does not exist. Your problem might be
>> related to a bug that some have reported in evaluating 
>> classes with the string ".!class". Try swapping the order
>> of the classes and see if it makes a difference
>> 
>> M
> 
> Nothing different.  Can you reproduce the problem on your side?  My example 
> is 
> pretty trivial...  I am running 2.1.0b2.
> 
> BTW, you dodged my other question. ;)  Is it documented somewhere that a 
> class 
> is either defined or not and that !class is true if the class is undefined?  
> If 
> not, it should. :)
> 
> ----->
> Appending [lmclxadm](BuildClassEnvironment)
> ---
> ENVIRONMENT: 
> CFALLCLASSES=any:cfengine_2_1_0b2:redhat:redhat_9:opt_debug:Tuesday:Hr14:Min48:Min45_50:Q4:Hr14_Q4:Day30:September:Yr2003:linux:snah1:32_bit:linux_2_4_20_6:i686:linux_i686:linux_i686_2_4_20_6:linux_i686_2_4_20_6__1_Thu_Feb_27_10_06_59_EST_2003:compiled_on_linux_gnu:localhost:net_iface_lo:net_iface_eth0:142_133_112_30:snah1_dyn_lmc_ericsson_se:142_133_112:ipv4_142_133_112_30:ipv4_142_133_112:ipv4_142_133:ipv4_142:lmclxadm:
> ---
> 
>                    New temporary class additions
>                    --------( Pass 1 )-------
>                               lmclxadm
> Actionsequence item shellcommands
> Job start time set to Tue Sep 30 14:48:18 2003
> 
> ---------------------------------------------------------------------
> Alerts
> ---------------------------------------------------------------------
> 
> 
> 
> ++++++++++++++++++++++++++++++++++++++++
> Summary of objects involved
> ++++++++++++++++++++++++++++++++++++++++
> 
>      global
>      main
> <-----
> 
> Best regards,
> Hans Deragon
> --
> Consultant en informatique/Software Consultant
> Deragon Informatique inc.         Open source:
> http://www.deragon.biz            http://swtmvcwrapper.sourceforge.net
> mailto://hans@deragon.biz         http://autopoweroff.sourceforge.net
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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]