"returnszero" not working as expected

Xander Cage <[email protected]> Tue, 3 Sep 2024 06:04:45 -0700 (PDT)
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
Hi,

came across another weird thing...

i am running a command and setting a class on the return code...nothing 
special

EN_NEEDS_CHANGE_SENDSPACE_$(device)"   expression => returnszero 
("/usr/sbin/lsattr -El $(device) -a tcp_sendspace -F value | /usr/bin/grep 
-q 1048576", "useshell");

until now, i was sure the class is set wenn return is 0...unfortunatly not 
in this case.

verbose output:

 verbose: returnszero ran '/usr/sbin/lsattr -El en1 -a tcp_sendspace -F 
value | /usr/bin/grep -q 1048576' successfully and it returned zero
 verbose: Caching result for function 'returnszero("/usr/sbin/lsattr -El 
$(device) -a tcp_sendspace -F value | /usr/bin/grep -q 1048576","useshell")'
 verbose: C:     +  Private class: EN_NEEDS_CHANGE_SENDSPACE_en1

hmm...scratching my head...but i dont get it...it says the command returned 
zero but the class is set.

if i do this it works as expected...

 "EN_NEEDS_CHANGE_SENDSPACE_$(device)"   not => returnszero 
("/usr/sbin/lsattr -El $(device) -a tcp_sendspace -F value | /usr/bin/grep 
-q 1048576", "useshell");

i mean, i have no problem with setting it to "not", but an explaination of 
this reversed
behaviour would be nice.

cfe version is 3.21.5, platform is aix

chris

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/432493b5-63aa-4b75-ad81-96e27fc49c67n%40googlegroups.com.