Re: update_policy.cf fails in 3.18.1

"'Nick Anderson' via help-cfengine" <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
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/878rtr55vy.fsf%40northern.tech.

-- 
Nick Anderson | Doer of Things | (+1) 785-550-1767 | https://northern.tech

-- 
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/878rtr55vy.fsf%40northern.tech.
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.