The issue is that Cfengine does a fair amount of compile-time checking and
optimization, and if you want to think of it this way, tweaking the
bundlesequence with "ignore_missing_bundles" is a pre-processor tweak (where
you can say "continue somiling if this bundle is missing"), whereas methods
promises are more "runtime" issues (in that they can be moderated at runtime
by more complex factors like classes).

This is the reason why you still get the "Undeclared promise bundle" error.
Because at compiletime, Cfengine sees that the bundle is missing (regardless
of whether you use ifvarclass, etc).  At compiletime, you can decide to skip
everything in a bundlesequence, but ifvarclass (and any class statement) is
runtime.

I hope that made as much sense coming out of my mouth(fingers) as it did
inside of my head...

-Dan

> Forum: Cfengine Help
> Subject: Re: Cfengine Help: methods and undeclared bundles
> Author: matter
> Link to topic: https://cfengine.com/forum/read.php?3,16648,16649#msg-16649
> 
> Unfortunately, this appears to be for the bundlesequence only:
> 
> ##########################################################################
> 
> body common control {
> 
>     bundlesequence => { "test" };
>     ignore_missing_bundles => "true";
> }
> 
> 
> ##########################################################################
> 
> bundle agent test {
> 
>   methods:
> 
>     "any" usebundle  => undefined_bundle,
>           ifvarclass => "not_defined_at_all";
> 
> }
> 
> ##########################################################################
> 
>  % cf-agent -Kf ./btest.cf 
> Undeclared promise bundle "undefined_bundle()" was referenced in a promise
> Summarizing promises as text to ./btest.cf.txt
> Summarizing promises as html to ./btest.cf.html
> cf-agent was not able to get confirmation of promises from cf-promises, so go
> ing to failsafe
> 
> _______________________________________________
> 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