Skip to content

Commit

Permalink
Merge pull request #2948 from nickanderson/CFE-4442/master
Browse files Browse the repository at this point in the history
CFE-4442: Clarified need to specify namespace when defining custom policy update bundle
  • Loading branch information
nickanderson authored Oct 10, 2024
2 parents 0aa403d + 07fac61 commit 5f5523e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 3 additions & 1 deletion MPF.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ Override this bundle by setting `def.mpf_update_policy_bundle` via augments:
{
"variables": {
"default:def.mpf_update_policy_bundle": {
"value": "MyCustomPolicyUpdateBundle"
"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 5f5523e

Please sign in to comment.