mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
fixed issue with multiple calls to Add-DeprecationWarning
This commit is contained in:
parent
8c364f8f81
commit
db91dd8685
1 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ Function Add-Warning($obj, $message)
|
||||||
# so he does not have to check for the attribute prior to adding.
|
# so he does not have to check for the attribute prior to adding.
|
||||||
Function Add-DeprecationWarning($obj, $message, $version = $null)
|
Function Add-DeprecationWarning($obj, $message, $version = $null)
|
||||||
{
|
{
|
||||||
if (Get-Member -InputObject $obj -Name "deprecations") {
|
if ($obj.ContainsKey("deprecations")) {
|
||||||
if ($obj.deprecations -is [array]) {
|
if ($obj.deprecations -is [array]) {
|
||||||
$obj.deprecations += @{
|
$obj.deprecations += @{
|
||||||
msg = $message
|
msg = $message
|
||||||
|
@ -123,7 +123,7 @@ Function Add-DeprecationWarning($obj, $message, $version = $null)
|
||||||
throw "deprecations attribute is not a list"
|
throw "deprecations attribute is not a list"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$obj.deprecations = ,@(
|
$obj.deprecations = @(
|
||||||
@{
|
@{
|
||||||
msg = $message
|
msg = $message
|
||||||
version = $version
|
version = $version
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue