I did a little more digging on the verbose outputs of an initial read
and then the reread. Here is a good read:

GetVariable(bundles,sys.workdir) type=(to be determined)
IsExpandable(sys.workdir) - syntax verify
Found 0 variables in (sys.workdir)
Variable identifier workdir is prefixed with scope id sys
Searching for scope context sys
Found scope reference sys
Looking for sys.workdir
GetVariable(sys,workdir): using scope 'sys' for variable 'workdir'
return final variable type=string, value={
/var/cfengine}
  Add |/var/cfengine/etc/| to str, waiting at |$(sys.fqhost)|
ExtractOuterVarString($(sys.fqhost)) - syntax verify
Extracted outer variable |$(sys.fqhost)|
ExtractInnerVarString( $(sys.fqhost) ) - syntax verify
Returning substring value sys.fqhost

Here is the re-read:
GetVariable(bundles,sys.workdir) type=(to be determined)
IsExpandable(sys.workdir) - syntax verify
Found 0 variables in (sys.workdir)
Variable identifier workdir is prefixed with scope id sys
Searching for scope context sys
Found scope reference sys
Looking for sys.workdir
GetVariable(sys,workdir): using scope 'sys' for variable 'workdir'
No such variable found bundles.sys.workdir                 <======= DIFFERENT
  Currently non existent or list variable $(sys.workdir)
  Add |$(sys.workdir)/etc/| to str, waiting at |$(sys.fqhost)|
ExtractOuterVarString($(sys.fqhost)) - syntax verify
Extracted outer variable |$(sys.fqhost)|
ExtractInnerVarString( $(sys.fqhost) ) - syntax verify
Returning substring value sys.fqhost


>From some reason, the scope is somehow altered on reread. On a reread
it seems that sys.workdir is put under bundles.sys.workdir scope. I
maybe all wet, but that seems to be where it is going wrong.



On Fri, Jun 12, 2009 at 10:07 AM, Matt Richards<[email protected]> wrote:
> A weird error for a cf-serverd rereading config files. Say I have this
> configuration:
>
> body common control {
>
>    bundlesequence => { @(bundles.bundles) };
>    inputs         => { @(bundles.inputs) };
> }
>
> bundle common bundles {
>
>  vars:
>
>    "host_array"  int =>
> readstringarray("host","$(sys.workdir)/etc/$(sys.fqhost)","#[^\n]*",":",10,4000);
>    "bundles"     slist => splitstring("$(host[bundles][1])",",","500");
>    "inputs"      slist => splitstring("$(host[inputs][1])",",","500");
>
>
> }
>
>
> Firing up cf-serverd, works like a champ. However, if promises.cf is
> changed and cf-serverd rereads the config:
>
> cf3 Rereading config files /var/cfengine/inputs/promises.cf..
> cf3 Already know our hard classes...
> cf3 Interface 1: en0
> cf3 Interface 2: en0
> cf3 Interface 3: lo0
> cf3 Interface 4: lo0
> cf3 Interface 5: lo0
> cf3 Trying to locate my IPv6 address
> cf3 Looking for environment from cf-monitor...
> cf3 Loading environment...
> cf3 Environment data loaded
> cf3 Reference time set to Fri Jun 12 10:00:00 2009
> cf3   > Parsing file /var/cfengine/inputs/promises.cf
> cf3 Initiate variable convergence...
> cf3 Can't stat file "/var/cfengine/inputs/@(bundles.inputs)" for parsing
> cf3 (stat: No such file or directory)
>
> However, if I change the common bundle to not use readstringarray, it will 
> work:
>
> bundle common bundles {
>
>  vars:
>
> "bundles" slist => { "cfengine" };
> "inputs" slist => { "cfengine.cf","site.cf","library.cf"};
>
> }
>
>
> It appears that the reread is not expanding readstringarray like it
> does on the initial startup.
>

_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to