Good catch, Michael - but here's the weird bit - it turns out that the list is 
actually there, you just can't iterate over it!

-Dan

body common control {
   bundlesequence => { setup, atest };
   version        => "0.01";
}

bundle agent setup {

files:

    "/tmp/foo" create => "true", edit_line => maketest;
}

bundle edit_line maketest {

insert_lines:

    "123";
#    "qaz";
}

bundle agent atest {

vars:

    "words"  slist => readstringlist("/tmp/foo","#.*","NoWayJose",99,9999);     
 
    "sum" real => sum("words");

reports:

    agent::

    ">>$(words)";
    "sum>>$(sum)";
}
                                                                             

On Nov 9, 2010, at 3:22 PM, Michael Potter wrote:

> It seems that readstringlist in 3.1.0 has trouble reading a single
> word/line from a file. The attached self-enclosed bundle will create a
> file /tmp/foo with a single word in it. If you run it under 3.0.5, it
> successfully reads that single word and reports on it. Under 3.1.0, it
> is not able to extract the word from the file. Note that if multiple
> lines/words are added to the file, 3.1.0 *is* able to extract the
> words.
> 
> Do others see the same thing? Is there a way to write the separator
> regex such that it works under 3.1.0?
> <atest.cf>_______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine

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

Reply via email to