Forum: Cfengine Help
Subject: Re: Weird unset variable warning?
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,21129,21131#msg-21131

I think this message is a red herring.  The join seems to function in spite of 
the error.  I'm curious as to why you are using an external find instead of 
Cfengine built in file selection?

body common control
{
bundlesequence          => { "test" };
}

bundle agent test
{
vars:
    linux::
      "find_path"      string => "/usr/bin/find";
      "fn_arg"         string => "-iname";
    any::
      "server_root"      string => "/tmp";
      "extensions"       slist  => { "*.pl", "*.cgi", "*.cf"   };
      "fn_ext_arg"     string => join( " -o $(fn_arg) ", "extensions" );
      "find_arg"       string => "$(server_root) $(fn_arg) $(fn_ext_arg)";



    reports:
        linux::
                "command: ${find_path} ${find_arg}";

}

$ cf-promises -f ./forum.cf 
$ cf-agent -IKf ./forum.cf 
 !! Unresolved variables in rval of "find_arg" in scope test
R: command: /usr/bin/find /tmp -iname *.pl -o -iname *.cgi -o -iname *.cf
$ echo $?
0


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

Reply via email to