By the way, if you take out the whitespace_policy line, as expected,
you get two lines that differ only in whitespace.

Due to the whitespace_policy issue, I also tried something that
distills down to:

bundle edit_line cc_doexport(line)
{
  delete_lines:
      "/export/dir1\s\s+192.168.159.0/255.255.255.0(rw)";

  insert_lines:
      "$(line)";
}

Here, the delete_lines fail to delete the line the test.sh script creates.

-rdp

On Mon, Jun 11, 2012 at 10:03 AM, Ron Parker <rdpar...@gmail.com> wrote:
> On Fri, Jun 8, 2012 at 6:41 PM, Nick Anderson <n...@cmdln.org> wrote:
>
>> Hey Ron, can you post a self contained example?
>
> Here's my minimal test for the eternally growing exports file.
>
> # begin test.sh
> #! /bin/sh
> printf '/export/dir1\t\t192.168.159.0/255.255.255.0(rw)\n' > /tmp/exports
>
> cf-agent -KIf test.cf           # duplicates, not matching above
> cf-agent -KIf test.cf           # duplicates, not even matching itself
>
> cat /tmp/exports
> # end test.sh
>
> # begin test.cf
> body common control
> {
>      bundlesequence => { "test" };
> }
>
> bundle agent test
> {
> files:
>      "/tmp/exports"
>      edit_line =>
> cc_doexport("/export/dir1       192.168.159.0/255.255.255.0(rw)"); # Single
> tab in the middle of the string
> }
>
> bundle edit_line cc_doexport(line)
> {
>  insert_lines:
>      "$(line)"
>      whitespace_policy => { "ignore_embedded" };
> }
> #end test.cf
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to