Skip to content

Commit

Permalink
Merge pull request #2951 from nickanderson/CFE-4442/3.21.x
Browse files Browse the repository at this point in the history
CFE-4442: Clarified need for namespace to be specified when defining a custom policy update bundle (3.21)
  • Loading branch information
nickanderson authored Oct 10, 2024
2 parents 1093fee + 028cea3 commit c05b0ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
8 changes: 6 additions & 2 deletions MPF.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,16 @@ Override this bundle by setting `def.mpf_update_policy_bundle` via augments:

```json
{
"vars": {
"mpf_update_policy_bundle": "MyCustomPolicyUpdateBundle"
"variables": {
"default:def.mpf_update_policy_bundle": {
"value": "default:MyCustomPolicyUpdateBundle"
}
}
}
```

**NOTE:** Be sure to specify the namespace the bundle is in, for example, `default`.

**History:**

* Introduced in 3.12.0
Expand Down
14 changes: 6 additions & 8 deletions cfe_internal/update/update_policy.cf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bundle agent cfe_internal_update_policy

# Look for a bundle that matches what the user wants
"found_matching_user_specified_bundle"
slist => bundlesmatching( "$(def.mpf_update_policy_bundle)" );
slist => bundlesmatching( "^$(def.mpf_update_policy_bundle)$" );

methods:

Expand Down Expand Up @@ -71,18 +71,16 @@ bundle agent cfe_internal_update_policy
inform_mode|verbose_mode|DEBUG|DEBUG_cfe_internal_update_policy::
# Report a human readable way to understand the policy behavior

"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";

"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" );
any::
"WARNING User specified update bundle '$(def.mpf_update_policy_bundle)' does not specify a namespace. Please specify a namespace, e.g. 'default:$(def.mpf_update_policy_bundle)'."
if => and( not(regcmp( ".*:.*", $(def.mpf_update_policy_bundle) ) ),
"have_user_specified_update_bundle" );
}

bundle agent cfe_internal_setup_python_symlink(symlink_path)
Expand Down

0 comments on commit c05b0ab

Please sign in to comment.