Forum: CFEngine Help
Subject: Re: setup a class if hosts is part of another class
Author: milindk
Link to topic: https://cfengine.com/forum/read.php?3,25150,25152#msg-25152

Hi Neil

body common control
     {
 bundlesequence => { "test2"};
 inputs => { "/var/cfengine/inputs/cfengine_stdlib.cf" };
 host_licenses_paid => "100";
     }

bundle common function {

classes:

"HOST" or => {"hostA", "hostB", "hostC"};
}

bundle common def {

classes:

"ISTHERE" expression => {"HOST"};
}

bundle agent test2 {
vars:

reports:
 cfengine::
  "ok";
}


when I do 

 i get error

nova> ./h.cf:19,32: !! Type mistach -- rhs is a list, but lhs (class) is not a 
list type, near token '}'
nova> ./h.cf:19,32: !! Type mistach -- rhs is a list, but lhs (class) is not a 
list type, near token '}'
nova> Initiate variable convergence...
nova>  -> Checking common class promises...
nova>  -> Checking common class promises...
nova> ./h.cf:30,0: !! Type mistach -- rhs is a list, but lhs (class) is not a 
list type, near token ''
nova> ./h.cf:30,0: !! Type mistach -- rhs is a list, but lhs (class) is not a 
list type, near token ''
nova>   > Parsing file /var/cfengine/inputs/cfengine_stdlib.cf
nova> Initiate variable convergence...
nova>  -> Checking common class promises...
nova>  -> Checking common class promises...
nova> /var/cfengine/inputs/cfengine_stdlib.cf:1607,0: !! Type mistach -- rhs is 
a list, but lhs (class) is not a list type, near token ''
nova> /var/cfengine/inputs/cfengine_stdlib.cf:1607,0: !! Type mistach -- rhs is 
a list, but lhs (class) is not a list type, near token ''



if change it to or from expression 

va>  !! You could be in violation of contract.
nova> Ignoring caching of lastseen hosts into database - we are not a policy 
server
nova>  -> Inputs are valid
bash-3.2#


that is how I was using it in my promisses but it is causing some weird error 
hence i wanted to see if there is any fuction that I can use to verify hosts is 
part of perticular class and then set another class

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to