Forum: Cfengine Help
Subject: Re: vars policy => "ifdefined" broken
Author: Igor
Link to topic: https://cfengine.com/forum/read.php?3,18061,18552#msg-18552

There is my 5 cents:

promise.cf:

#######################################################

bundle common my_common_values
{

vars:
    
    "adm_group_10" expression => classmatch("vm\d_canyon_local");
    "one_group" expression => classmatch("vm\d_canyon_local");
    "two_group" expression => classmatch("vm\d_canyon_local");
    "three_group" expression => classmatch("vm\d_none_server");
    "four_group" expression => classmatch("vm\d_none_server");
    "five_group" expression => classmatch("vm\d_none_server");
   
}
    
body common control

{

version => "0.0.1";


adm_group_10::
bundlesequence  => {  "test1" };

any::
inputs          => { "update.cf",
                   "site.cf",
                   "library.cf",
                   "unit_test.cf"
                   };

{skip}

################################################

################################################

unit_test.cf:


bundle agent test1 {
  vars:

    one_group::
    "one" slist => { "one" };

    two_group::
    "two" slist => { "two" };

    three_group::
    "three" slist => { "three" };

    four_group::
    "four" slist => { "four" };

    five_group::
    "four" slist => { "four" };


# (or any::)
   adm_group_10::
    "alist" slist => { "@(one)", "@(two)", "@(three)", "@(four)", "@(five)" },
    policy => "ifdefined";


# commands:
# "/bin/echo $(alist)";

reports:
Yr2010::
      "List contains: $(alist)";


}

######################################################
#cf-promise -v
{skip}
cf3  -> Checking common class promises...
cf3  ?> defining additional global class adm_group_10
cf3  ?> defining additional global class one_group
cf3  ?> defining additional global class two_group
{skip}
cf3  -> Negated Classes = { }
cf3 Initiate variable convergence...
cf3  -> Checking common class promises...
cf3  -> Inputs are valid

#####################################################
#cf-agent -v -K

{skip}

cf3    =========================================================
cf3    reports in bundle test1 (1)
cf3    =========================================================
cf3
cf3 Verifying SQL table promises is only available with Cfengine Nova or above
cf3
cf3     .........................................................
cf3     Promise handle:
cf3     Promise made by: List contains: one
cf3     .........................................................
cf3
cf3 Reporting about this...
cf3 R: List contains: one
cf3
cf3     .........................................................
cf3     Promise handle:
cf3     Promise made by: List contains: two
cf3     .........................................................
cf3
cf3 Reporting about this...
cf3 R: List contains: two
cf3
cf3     .........................................................
cf3     Promise handle:
cf3     Promise made by: List contains: @(four)
cf3     .........................................................
cf3
cf3 Reporting about this...
cf3 R: List contains: @(four)




So, i see @(four). Looks like it error.


---
Igor

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

Reply via email to