ok - this is fixable if clumsily by

if (...)
 {
 with++;
 }

etc

Matt Richards wrote:
> Greetings. I found an issue with using insert_select. It appears that
> it will always fail the sanity checks:
> 
> body insert_select test(x) {
>   insert_if_not_match_from_list => { "$(x).*" };
> }
> 
> In SanityCheckInsertions (files_editline:852):
> 
> int SanityCheckInsertions(struct Attributes a)
> 
> { long not = 0;
>   long with = 0;
>   long ok = true;
> 
> with += (long)a.line_select.startwith_from_list;
> not += (long)a.line_select.not_startwith_from_list;
> with += (long)a.line_select.match_from_list;
> not += (long)a.line_select.not_match_from_list;
> with += (long)a.line_select.contains_from_list;
> not += (long)a.line_select.not_contains_from_list;
> 
> if (not > 1)
>    {
>    CfOut(cf_error,"","Line insertion selection promise is meaningless
> - the alternatives are mutually exclusive (only one is allowed)");
>    ok = false;
>    }
> 
> If any insert_select is used, it will use the (long) value, which will
> it it way over the top:
> 
> (dbx) p (long)  a.line_select.not_match_from_list
> 539456664
> 
> so, no +=(long) a.line_select.not_match_from_list, will make it not
> waaay over 1, even though there is only one insert_select.
> 
> I see what you are trying to do by testing is you have two "not" or
> what not, but I am not sure how it should be fix.
> _______________________________________________
> Bug-cfengine mailing list
> Bug-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/bug-cfengine

-- 
Mark Burgess

-------------------------------------------------
Professor of Network and System Administration
Oslo University College, Norway

Personal Web: http://www.iu.hio.no/~mark
Office Telf : +47 22453272
-------------------------------------------------
_______________________________________________
Bug-cfengine mailing list
Bug-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to