Actions
Bug #21502
closedAdapt webapp policy generation to 7.2 technique syntax
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No
Description
The new syntax is:
function My-Technique { [CmdletBinding()] param ( [Parameter(Mandatory=$True)] [String]$ReportId, [Parameter(Mandatory=$True)] [String]$TechniqueName, [Rudder.PolicyMode]$PolicyMode ) $ReportIdBase = $reportId.Substring(0,$reportId.Length-1) $localContext = [Rudder.Context]::new() $localContext.Merge($system_classes) $resourcesDir = $PSScriptRoot + "\resources" # --------------Method Call 1------------- # $ReportId = $ReportIdBase+"8b575191-0ab0-4851-b05c-e7cde3726f05" $common_params = @{ ClassPrefix = "pwd" ComponentKey = "pwd" ComponentName = "Command execution" PolicyMode = $PolicyMode ReportId = $ReportId TechniqueName = $TechniqueName } if ($localContext.Evaluate("sles_12")) { $call_params = @{ Command = "pwd" PolicyMode = $PolicyMode } $call = Command-Execution @call_params $compute_params = $common_params + @{ MethodCall = $call } $context = Compute-Method-Call @compute_params $localContext.merge($context) } else { Rudder-Report-NA @common_params } # --------------Method Call 2------------- # # ... }
Actions