Skip to content

Commit 51d932c

Browse files
authored
Merge pull request #3044 from nickanderson/CFE-4588/master
CFE-4588: Fixed duplicate bundlesequence_end when bundlesequence_classification not defined
2 parents 843a917 + ff02373 commit 51d932c

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

controls/def.cf

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,33 @@ bundle common def
278278
# Common Controls
279279

280280
# Because in some versions of cfengine bundlesequence in body common
281-
# control does not support does not support iteration over data containers
282-
# we must first pick out the bundles into a shallow container that we can
283-
# then get a regular list from using getvalues().
281+
# control does not support iteration over data containers we must first
282+
# pick out the bundles into a shallow container that we can then get a
283+
# regular list from using getvalues().
284284

285-
"tbse" data => mergedata( "def.control_common_bundlesequence_end" );
286-
"bundlesequence_end" slist => getvalues( tbse );
287-
288-
"tbse" data => mergedata( "def.control_common_bundlesequence_classification" );
289-
"bundlesequence_classification" slist => getvalues( tbse );
285+
"bundlesequence_end" -> { "CFE-4855" }
286+
slist => { },
287+
if => not( isvariable( "def.control_common_bundlesequence_end") ),
288+
comment => concat( "We define an empty list so that the agent will not",
289+
" error about undefined variable when ",
290+
" def.bundlesequence_end is not defined." );
291+
"bundlesequence_end" -> { "CFE-4855" }
292+
slist => getvalues( mergedata( "def.control_common_bundlesequence_end" ) ),
293+
comment => concat( "We define bundlesequence_end from Augments if it's",
294+
" available. This allows for customization without",
295+
" modifying the vendored policy." );
296+
297+
"bundlesequence_classification" -> { "CFE-4855" }
298+
slist => { },
299+
if => not( isvariable( "def.control_common_bundlesequence_classification") ),
300+
comment => concat( "We define an empty list so that the agent will not",
301+
" error about undefined variable when ",
302+
" def.bundlesequence_classification is not defined." );
303+
"bundlesequence_classification" -> { "CFE-4855" }
304+
slist => getvalues( mergedata( "def.control_common_bundlesequence_classification" ) ),
305+
comment => concat( "We define bundlesequence_classification from Augments if it's",
306+
" available. This allows for customization without",
307+
" modifying the vendored policy." );
290308

291309
"control_common_ignore_missing_bundles" -> { "CFE-2773" }
292310
string => ifelse( strcmp( $(control_common_ignore_missing_bundles), "true" ),

0 commit comments

Comments
 (0)