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

Hi all,

I have some interesting behaviour with the vars menu option 'policy => 
"ifdefined"'. It seems to give some unpredictable behaviour. I'm pretty sure 
I'm using it as the CF3 manual describes. See the example below:

# cat one.cf

bundle agent one {
  vars:
    "var_list" slist => { "one" };
}



# cat two.cf

bundle agent two {
  vars:
    "var_list" slist => { "two" };
}


# cat test.cf

body common control {
  inputs => { "one.cf", "two.cf" };
  bundlesequence => { "one", "two", "test" };
}

bundle agent test {
  vars:
    "list" slist => { @(one.var_list), @(two.var_list) }, policy => "ifdefined";

  reports:
    Yr2010::
      "List contains: $(list)";
}


# cf-agent -Kf ./test.cf

R: List contains: one.cf
R: List contains: control_common


That is some very strange output. Then if you remove the "ifdefined" policy, it 
behaves as you would expect:

# cat test.cf

body common control {
  inputs => { "one.cf", "two.cf" };
  bundlesequence => { "one", "two", "test" };
}

bundle agent test {
  vars:
    "list" slist => { @(one.var_list), @(two.var_list) };#, policy => 
"ifdefined";

  reports:
    Yr2010::
      "List contains: $(list)";
}



# cf-agent -Kf ./test.cf

R: List contains: one
R: List contains: two


A possible bug? If so, how can I file it?

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

Reply via email to