windows: removed deprecated features in 2.6 (#38930)

* windows: removed deprecated features in 2.6

* Comma surgery.
This commit is contained in:
Jordan Borean 2018-04-26 06:13:37 +10:00 committed by GitHub
commit f8853d83e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 32 additions and 197 deletions

View file

@ -1,24 +1,10 @@
#!powershell
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Copyright: (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# WANT_JSON
# POWERSHELL_COMMON
#Requires -Module Ansible.ModuleUtils.Legacy
$ErrorActionPreference = 'Stop'
@ -51,12 +37,7 @@ if ($input_attributes) {
# Uses dict style parameters, newer and recommended style
$attributes = $input_attributes
} else {
# Uses older style of separating with | per key pair and : for key:value (paramA:valueA|paramB:valueB)
Add-DeprecationWarning -obj $result -message "Using a string for the attributes parameter is deprecated, please use a dict instead" -version 2.6
$input_attributes -split '\|' | ForEach-Object {
$key, $value = $_ -split "\:"
$attributes.$key = $value
}
Fail-Json -obj $result -message "Using a string for the attributes parameter is not longer supported, please use a dict instead"
}
}
$result.attributes = $attributes