Re: Re: abort_bundle_classe are not working...somwhat
Xander Cage <[email protected]> Tue, 30 Jul 2024 05:38:55 -0700 (PDT)
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
i tested with 3.21.5...
abort and abortbundleclasses defined in augments...
"variables": {
"default:def.control_agent_abortclasses": {
"value": [
"abort_.*"
],
}
"default:def.control_agent_abortbundleclasses": {
"value": [
"bundle_abort_.*"
],
}
}
still parsing errros...
root@aixtest01: /var/cfengine/inputs # /var/cfengine/bin/cf-agent -KIv |
grep abort
verbose: Installing augments slist variable
'default:def.control_agent_abortclasses' from file
'/var/cfengine/inputs/def.json'
verbose: Installing augments slist variable
'default:def.control_agent_abortbundleclasses' from file
'/var/cfengine/inputs/def.json'
verbose: Skipping promise 'control_agent_abortclasses' because constraint
'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortbundleclasses' because
constraint 'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortclasses' because constraint
'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortbundleclasses' because
constraint 'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortclasses' because constraint
'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortbundleclasses' because
constraint 'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortclasses' because constraint
'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortbundleclasses' because
constraint 'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortclasses' because constraint
'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Skipping promise 'control_agent_abortbundleclasses' because
constraint 'if => not(isvariable("$(this.promiser)"))' is not met
verbose: Setting abort classes from ...
verbose: Setting abort bundle classes from ...
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
error: Unable to parse class expression 'bundle_abort_.*'
as mentioned numerious time..this only occurs when the abortclasses are
defined in augments...
when defining it in policy no error are emitted...
body agent control
{
# List of regular expressions to match classes. When the class is
found to
# be defined, the agent will abort execution of the bundle.
#
https://docs.cfengine.com/docs/master/reference-components-cf-agent.html#abortbundleclasses
# BUG: aborbundleclasses errors with regular expressions, wrongly.
# "abort_bundle_sys_host_not_match_sys_uqhost"
abortbundleclasses => { "abort_bundle.*" };
}
bundle agent __main__
{
methods:
"bundle1";
"bundle2";
reports:
"CFEngine: $(sys.cf_version)";
}
bundle agent bundle1
{
classes:
"abort_bundle_sys_fqhost_matches_sys_uqhost"
expression => strcmp( $(sys.fqhost), $(sys.uqhost) );
methods: # More bundles, they wont be called because it aborts ...
reports: "$(this.bundle) here!";
}
bundle agent bundle1_1
{
reports: "$(this.bundle) here!";
}
bundle agent bundle2
{
classes:
reports: "$(this.bundle) here!";
}
:
On Friday, September 11, 2020 at 3:38:52 PM UTC+2 [email protected]
wrote:
> Yes, I encountered the same error yesterday. If you use specific classes
> and not regular expressions it should work without emitting the errors
> about being unable to parse the class expression.
>
> I filed an issue for it yesterday:
> https://tracker.mender.io/browse/CFE-3411
>
> On Friday, September 11, 2020 at 6:56:37 AM UTC-5 Xander Cage wrote:
>
>> i noticed one more little thing..since upgrade to the new mpf version
>> this error is printed. it
>>
>> verbose: C: BEGIN classes / conditions (pass 1)
>>
>> error: Unable to parse class expression 'ITSV_BUNDLE_ABORT.*'
>> verbose: C: + Private class: percent_of_runs
>> error: Unable to parse class expression 'ITSV_BUNDLE_ABORT.*'
>>
>> verbose: V: Computing value of 'tags'
>> verbose: A: Promise was KEPT
>> verbose: P: END meta promise (tags)
>>
>>
>> first i thouhgt this is caused by the downlevel binary, but 3.12.5 makes
>> no difference. seems that the wildcard class expression in def.json is not
>> playing very well. ('ITSV_BUNDLE_ABORT.*')
>>
>> On Friday, September 11, 2020 at 1:13:07 PM UTC+2, Xander Cage wrote:
>>>
>>> hi nick,
>>>
>>> you are absolutley right, after upgrading mpf to 3.12.5 everything works
>>> fine...
>>>
>>> verbose:
>>> ----------------------------------------------------------------
>>> verbose: Begin policy/promise evaluation
>>> verbose:
>>> ----------------------------------------------------------------
>>> info: Using command line specified bundlesequence
>>> verbose: Using bundlesequence => {"b0040abort_test"}
>>> verbose: B:
>>> *****************************************************************
>>> verbose: B: BEGIN bundle b0040abort_test
>>> verbose: B:
>>> *****************************************************************
>>> verbose: V: Computing value of 'tags'
>>> verbose: A: Promise was KEPT
>>> verbose: P: END meta promise (tags)
>>> verbose: V: .........................................................
>>> verbose: V: BEGIN variables (pass 1)
>>> verbose: V: Computing value of 'userlist'
>>> verbose: C: .........................................................
>>> verbose: C: BEGIN classes / conditions (pass 1)
>>> verbose: C: + Private class: ITSV_BUNDLE_ABORT_INVALID_USER
>>> error: Bundle 'b0040abort_test' aborted on defined class
>>> 'ITSV_BUNDLE_ABORT_INVALID_USER'
>>> verbose: A: ...................................................
>>> verbose: A: Bundle Accounting Summary for 'b0040abort_test' in
>>> namespace default
>>> verbose: A: Promises kept in 'b0040abort_test' = 2
>>> verbose: A: Promises not kept in 'b0040abort_test' = 0
>>> verbose: A: Promises repaired in 'b0040abort_test' = 0
>>> verbose: A: Aggregate compliance (promises kept/repaired) for bundle
>>> 'b0040abort_test' = 100.0%
>>> verbose: A: ...................................................
>>> verbose: B:
>>> *****************************************************************
>>> verbose: B: END bundle b0040abort_test
>>> verbose: B:
>>> *****************************************************************
>>> verbose: No lock purging scheduled
>>> verbose: Logging total compliance, total 'Outcome of version CFEngine
>>> Promises.cf 3.12.5 (agent-0): Promises observed to be kept 100.00%,
>>> Promises repaired 0.00%, Promises not repaired 0.00%'
>>>
>>>
>>> thank you...
>>>
>>> chris
>>>
>>>
>>> On Thursday, September 10, 2020 at 6:52:14 PM UTC+2, Nick Anderson wrote:
>>>>
>>>> Xander Cage writes:
>>>>
>>>> i tested with an example policy, to reduce clutter… still no bundle
>>>>> abort…
>>>>>
>>>> Hi Christian,
>>>>
>>>> From your original post, I can see that you are running 3.12.2.
>>>>
>>>> verbose: Logging total compliance, total 'Outcome of version CFEngine Promises.cf 3.12.2 (agent-0): Promises observed to be kept 100.00%, Promises repaired 0.00%, Promises not repaired 0.00%'
>>>>
>>>> Are you running the MPF from 3.12.2 as well?
>>>>
>>>> I see that augments support for abortbundleclasses and abortclasses
>>>> were added in 3.12.3.
>>>> https://github.com/cfengine/masterfiles/commit/e2c4c1c57e51edcb46e80aa906048daea0b75192
>>>>
>>>> What if you pull in controls/cf_agent.cf and controls/def.cf from
>>>> 3.12.3?
>>>>
>>>> https://github.com/cfengine/masterfiles/blob/3.12.3/controls/cf_agent.cf
>>>> https://github.com/cfengine/masterfiles/blob/3.12.3/controls/def.cf
>>>>
>>>> Does it work then?
>>>>
>>>> – Nick Anderson | Doer of Things | (+1) 785-550-1767 <(785)%20550-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/eb41aedc-fd94-4e14-8cb6-54f642bea3dfn%40googlegroups.com.