Skip to content

Commit

Permalink
Merge branch 'branches/rudder/8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Félix Dallidet committed Oct 21, 2024
2 parents 150b63a + 65d3aaf commit 26f89ca
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 66 deletions.
3 changes: 1 addition & 2 deletions policies/rudderc/templates/technique.ps1.askama
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function {{ id|technique_name }} {
{%- else %}
Rudder-Report-NA @reportParams
{%- endif %}
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -80,7 +80,6 @@ function {{ id|technique_name }} {
Compute-Method-Call @fallBackReportParams -PolicyMode {{ m.policy_mode_override|policy_mode_fmt }} -ReportId $reportId -DisableReporting:${{ m.disable_reporting }} -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down
6 changes: 2 additions & 4 deletions policies/rudderc/tests/cases/general/escaping/technique.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if(Get-Service "Zabbix agent") { write-output "exists" }
} else {
Rudder-Report-NA @reportParams
}
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -106,7 +106,6 @@ if(Get-Service "Zabbix agent") { write-output "exists" }
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down Expand Up @@ -174,7 +173,7 @@ if(Get-Service "Zabbix agent") { write-output "exists" }
$call = Package-Present @methodParams -PolicyMode $policyMode
Compute-Method-Call @reportParams -MethodCall $call

} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -185,7 +184,6 @@ if(Get-Service "Zabbix agent") { write-output "exists" }
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down
3 changes: 1 addition & 2 deletions policies/rudderc/tests/cases/general/form/technique.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ htop
} else {
Rudder-Report-NA @reportParams
}
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -106,7 +106,6 @@ htop
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
TechniqueName = $techniqueName
}
Rudder-Report-NA @reportParams
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -46,7 +46,6 @@
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down
3 changes: 1 addition & 2 deletions policies/rudderc/tests/cases/general/min/technique.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ htop
$call = Package-Present @methodParams -PolicyMode $policyMode
Compute-Method-Call @reportParams -MethodCall $call

} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -60,7 +60,6 @@ htop
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down
6 changes: 2 additions & 4 deletions policies/rudderc/tests/cases/general/ntp/technique.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ htop
} else {
Rudder-Report-NA @reportParams
}
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -69,7 +69,6 @@ htop
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down Expand Up @@ -115,7 +114,7 @@ vars.node.inventory.os.fullName
} else {
Rudder-Report-NA @reportParams
}
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -126,7 +125,6 @@ vars.node.inventory.os.fullName
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ vars.param_in_condition.file
TechniqueName = $techniqueName
}
Rudder-Report-NA @reportParams
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -53,7 +53,6 @@ vars.param_in_condition.file
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down Expand Up @@ -95,7 +94,7 @@ echo "May be executed or not"
} else {
Rudder-Report-NA @reportParams
}
} catch [Nustache.Core.NustacheDataContextMissException] {
} catch [Nustache.Core.NustacheDataContextMissException], [Nustache.Core.NustacheException] {
$failedCall = [Rudder.MethodResult]::Error(
([String]::Format(
'The method call was skipped because it references an undefined variable "{0}"',
Expand All @@ -106,7 +105,6 @@ echo "May be executed or not"
Compute-Method-Call @fallBackReportParams -PolicyMode $policyMode -ReportId $reportId -DisableReporting:$false -MethodCall $failedCall
} catch {
$failedCall = [Rudder.MethodResult]::Error(
[Rudder.MethodStatus]::Error,
([String]::Format(
'The method call was skipped as an unexpected error was thrown "{0}"',
(Format-Exception $_)[1]
Expand Down
Loading

0 comments on commit 26f89ca

Please sign in to comment.