Re: update_policy.cf fails in 3.18.1

Beto <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
Thanks, Nick.  There still seems to be a gap in my understanding.

Here's where the update bundle is specified:

root@butcher1 [cfengine]# cf-promises -f ./inputs/update.cf 
--show-vars=default.def.mpf_update_policy_bundle
Variable name                            Variable value                     
                          Meta tags                                Comment 
                                
default:def.mpf_update_policy_bundle     update_templates                   
                          source=augments_file

Hers's where the input containing the update bundle is defined:

root@butcher1 [cfengine]# cf-promises -f ./inputs/update.cf 
--show-vars=default.def.update_inputs
Variable name                            Variable value                     
                          Meta tags                                Comment 
                                
default:def.update_inputs                 
{"/var/cfengine/inputs/update_templates.cf"}               
 source=augments_file

Here's the input file:

root@butcher1 [cfengine]# grep bundle inputs/update_templates.cf 
bundle agent update_templates { 

So what am I missing?

On Thursday, March 3, 2022 at 10:59:33 AM UTC-6 Nick Anderson wrote:

> Beta writes: 
>
> Again how can the user update bundle be BOTH found and missing? Please 
> tell me I'm missing something. 
>
> Let's see … 
>
> Found user specified update bundle and User specified update budnle: are 
> emited when have_user_specified_update_bundle is defined. 
>
>
> "Found user specified update bundle."
>   if => "have_user_specified_update_bundle";
>
> "User specified update bundle: $(def.mpf_update_policy_bundle)"
>   if => "have_user_specified_update_bundle";
>
> have_user_specified_update_bundle is defined when the variable 
> def.mpf_update_policy_bundle is defined. 
>
>
> "have_user_specified_update_bundle"
>   expression => isvariable( "def.mpf_update_policy_bundle" );
>
> We can see that the variable is not defined by default. 
>
>
> masterfiles$ git grep mpf_update_policy_bundle
> MPF.md:Override this bundle by setting `def.mpf_update_policy_bundle` via augments:
> MPF.md:        "mpf_update_policy_bundle": "MyCustomPolicyUpdateBundle"
> cfe_internal/update/update_policy.cf:# @description Users may define `def.mpf_update_policy_bundle` to override the
> cfe_internal/update/update_policy.cf:        expression => isvariable( "def.mpf_update_policy_bundle" );
> cfe_internal/update/update_policy.cf:        slist => bundlesmatching( "$(def.mpf_update_policy_bundle)" );
> cfe_internal/update/update_policy.cf:      "User specified update bundle: $(def.mpf_update_policy_bundle)"
>
> User specified update budnle MISSING! is emitted when both 
> have_user_specified_update_bundle and missing_user_specified_update_bundle 
> are defined. 
>
>
> "User specified update bundle MISSING! Falling back to $(default_policy_update_bundle)."
>   if => and( "have_user_specified_update_bundle",
>              "missing_user_specified_update_bundle"
>             );
>
> missing_user_specified_update_bundle is defined when there are not any 
> elements in found_matching_user_specified_bundle matching .*. 
>
>
> "missing_user_specified_update_bundle"
>  not  => some(".*", "found_matching_user_specified_bundle");
>
> And, found_matchign_user_specified_bundle is defined by searching for a 
> bundle matching the value def.mpf_update_policy_bundle. 
>
>
> "found_matching_user_specified_bundle"
>   slist => bundlesmatching( "$(def.mpf_update_policy_bundle)" );
>
> So, if you specify an update bundle and it's not actually defined, then 
> you have this case where it's both found (to be defined) and missing 
> because it's not actually defined. 
>
> If you want to open a pull request with improved language for describing 
> the conditions I am happy to review them. 
>

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/132afc79-10a7-4fbf-b502-2496f91824abn%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.