Skip to content

Commit

Permalink
Merge pull request #40778 from rallytime/oxygen-deprecations
Browse files Browse the repository at this point in the history
Start removing deprecated code for Oxygen release
  • Loading branch information
Mike Place committed Apr 23, 2017
2 parents 0093851 + 6d59ed9 commit b5179aa
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 335 deletions.
59 changes: 59 additions & 0 deletions doc/topics/releases/oxygen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,62 @@
====================================
Salt Release Notes - Codename Oxygen
====================================

Configuration Option Deprecations
---------------------------------

- The ``requests_lib`` configuration option has been removed. Please use
``backend`` instead.

Module Deprecations
-------------------

The ``win_psget`` module had the following changes:

- The ``psversion`` function was removed. Please use ``cmd.shell_info`` instead.

The ``win_service`` module had the following changes:

- The ``config`` function was removed. Please use the ``modify`` function
instead.
- The ``binpath`` option was removed from the ``create`` function. Please use
``bin_path`` instead.
- The ``depend`` option was removed from the ``create`` function. Please use
``dependencies`` instead.
- The ``DisplayName`` option was removed from the ``create`` function. Please
use ``display_name`` instead.
- The ``error`` option was removed from the ``create`` function. Please use
``error_control`` instead.
- The ``group`` option was removed from the ``create`` function. Please use
``load_order_group`` instead.
- The ``obj`` option was removed from the ``create`` function. Please use
``account_name`` instead.
- The ``password`` option was removed from the ``create`` function. Please use
``account_password`` instead.
- The ``start`` option was removed from the ``create`` function. Please use
``start_type`` instead.
- The ``type`` option was removed from the ``create`` function. Please use
``service_type`` instead.

State Deprecations
------------------

The ``archive`` state had the following changes:

- The ``tar_options`` and the ``zip_options`` options were removed from the
``extracted`` function. Please use ``options`` instead.

The ``cmd`` state had the following changes:

- The ``user`` and ``group`` options were removed from the ``run`` function.
Please use ``runas`` instead.
- The ``user`` and ``group`` options were removed from the ``script`` function.
Please use ``runas`` instead.
- The ``user`` and ``group`` options were removed from the ``wait`` function.
Please use ``runas`` instead.
- The ``user`` and ``group`` options were removed from the ``wait_script``
function. Please use ``runas`` instead.

The ``file`` state had the following changes:

- The ``show_diff`` option was removed. Please use ``show_changes`` instead.
9 changes: 0 additions & 9 deletions salt/cloud/clouds/msazure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3384,14 +3384,6 @@ def query(path, method='GET', data=None, params=None, header_dict=None, decode=T
search_global=False,
default='management.core.windows.net'
)
requests_lib = config.get_cloud_config_value(
'requests_lib',
get_configured_provider(), __opts__, search_global=False
)
if requests_lib is not None:
salt.utils.warn_until('Oxygen', '"requests_lib:True" has been replaced by "backend:requests", '
'please change your config')

backend = config.get_cloud_config_value(
'backend',
get_configured_provider(), __opts__, search_global=False
Expand All @@ -3416,7 +3408,6 @@ def query(path, method='GET', data=None, params=None, header_dict=None, decode=T
port=443,
text=True,
cert=certificate_path,
requests_lib=requests_lib,
backend=backend,
decode=decode,
decode_type='xml',
Expand Down
27 changes: 0 additions & 27 deletions salt/modules/win_psget.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,33 +74,6 @@ def _pshell(cmd, cwd=None, json_depth=2):
return ret


def psversion():
'''
Returns the Powershell version
This has been deprecated and has been replaced by ``cmd.shell_info`` Note
the minimum version return is 5 as ``dsc`` is not available for version
less than 5. This function will be removed in 'Oxygen' release.
CLI Example:
.. code-block:: bash
salt 'win01' dsc.psversion
'''
salt.utils.warn_until('Oxygen',
'The \'psversion\' has been deprecated and has been '
'replaced by \'cmd.shell_info\'.'
)
powershell_info = __salt__['cmd.shell_info']('powershell')
if powershell_info['installed']:
try:
return int(powershell_info['version'].split('.')[0])
except ValueError:
pass
return 0


def bootstrap():
'''
Make sure that nuget-anycpu.exe is installed.
Expand Down
195 changes: 0 additions & 195 deletions salt/modules/win_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,100 +974,9 @@ def create(name,
salt '*' service.create <service name> <path to exe> display_name='<display name>'
'''
# Deprecations
if 'binpath' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'binpath\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use \'bin_path\' '
'instead.'
)
if bin_path is None:
bin_path = kwargs.pop('binpath')

if 'DisplayName' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'DisplayName\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use \'display_name\' '
'instead.'
)
if display_name is None:
display_name = kwargs.pop('DisplayName')

if display_name is None:
display_name = name

if 'type' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'type\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use \'service_type\' '
'instead.'
)
if service_type is None:
service_type = kwargs.pop('type')

if 'start' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'start\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use \'start_type\' '
'instead.'
)
if start_type is None:
start_type = kwargs.pop('start')

if 'error' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'error\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use \'error_control\' '
'instead.'
)
if error_control is None:
error_control = kwargs.pop('error')

if 'group' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'group\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use '
'\'load_order_group\' instead.'
)
if load_order_group is None:
load_order_group = kwargs.pop('group')

if 'depend' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'depend\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use \'dependencies\' '
'instead.'
)
if dependencies is None:
dependencies = kwargs.pop('depend')

if 'obj' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'obj\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use \'account_name\' '
'instead.'
)
if account_name is None:
account_name = kwargs.pop('obj')

if 'password' in kwargs:
salt.utils.warn_until(
'Oxygen',
'The \'password\' argument to service.create is deprecated, and '
'will be removed in Salt {version}. Please use '
'\'account_password\' instead.'
)
if account_password is None:
account_password = kwargs.pop('password')

# Test if the service already exists
if name in get_all():
raise CommandExecutionError('Service Already Exists: {0}'.format(name))
Expand Down Expand Up @@ -1145,110 +1054,6 @@ def create(name,
return info(name)


def config(name,
bin_path=None,
display_name=None,
svc_type=None,
start_type=None,
error=None,
group=None,
tag=None,
depend=None,
obj=None,
password=None,
**kwargs):
r'''
.. deprecated:: 2016.11.0
Use ``service.modify`` instead
Modify the named service. Because this is deprecated it will use the passed
parameters to run ``service.modify`` instead.
Args:
name (str): Specifies the service name. This is not the display_name
bin_path (str): Specifies the path to the service binary file.
Backslashes must be escaped, eg: C:\\path\\to\\binary.exe
display_name (str): the name to be displayed in the service manager
svc_type (str): Specifies the service type. Default is ``own``.
Valid options are as follows:
- kernel: Driver service
- filesystem: File system driver service
- adapter: Adapter driver service (reserved)
- recognizer: Recognizer driver service (reserved)
- own (default): Service runs in its own process
- share: Service shares a process with one or more other services
start_type (str): Specifies the service start type. Valid options are as
follows:
- boot: Device driver that is loaded by the boot loader
- system: Device driver that is started during kernel initialization
- auto: Service that automatically starts
- manual (default): Service must be started manually
- disabled: Service cannot be started
error (str): The severity of the error, and action taken, if this
service fails to start. Valid options are as follows:
- normal (normal): Error is logged and a message box is displayed
- severe: Error is logged and computer attempts a restart with the
last known good configuration
- critical: Error is logged, computer attempts to restart with the
last known good configuration, system halts on failure
- ignore: Error is logged and startup continues, no notification is
given to the user
group: The name of the load order group to which this service
belongs
depend (list): A list of services or load ordering groups that
must start before this service
obj (str): The name of the account under which the service should run.
For ``own`` type services this should be in the ``domain\username``
format. The following are examples of valid built-in service
accounts:
- NT Authority\\LocalService
- NT Authority\\NetworkService
- NT Authority\\LocalSystem
- .\\LocalSystem
password (str): The password for the account name specified in
``account_name``. For the above built-in accounts, this can be None.
Otherwise a password must be specified.
Returns:
dict: a dictionary of changes made
CLI Example:
.. code-block:: bash
salt '*' service.config <service name> <path to exe> display_name='<display name>'
'''
salt.utils.warn_until(
'Oxygen',
'The \'service.change\' function is deprecated, and will be removed in '
'Salt {version}. Please use \'service.modify\' instead.')

return modify(name=name,
bin_path=bin_path,
display_name=display_name,
service_type=svc_type,
start_type=start_type,
error_control=error,
load_order_group=group,
dependencies=depend,
account_name=obj,
account_password=password)


def delete(name):
'''
Delete the named service
Expand Down
27 changes: 0 additions & 27 deletions salt/states/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def extracted(name,
- source: salt://apps/src/myapp-16.2.4.tar.gz
- user: www
- group: www
- tar_options: --strip-components=1
With the rewrite for 2016.11.0, these workarounds are no longer
necessary. ``if_missing`` is still a supported argument, but it is no
Expand Down Expand Up @@ -413,8 +412,6 @@ def extracted(name,
``tar``/``unzip`` implementation on the minion's OS.
.. versionadded:: 2016.11.0
The ``tar_options`` and ``zip_options`` parameters have been
deprecated in favor of a single argument name.
.. versionchanged:: 2015.8.11,2016.3.2
XZ-compressed tar archives no longer require ``J`` to manually be
set in the ``options``, they are now detected automatically and
Expand All @@ -426,15 +423,6 @@ def extracted(name,
For tar archives, main operators like ``-x``, ``--extract``,
``--get``, ``-c`` and ``-f``/``--file`` should *not* be used here.
tar_options
.. deprecated:: 2016.11.0
Use ``options`` instead.
zip_options
.. versionadded:: 2016.3.1
.. deprecated:: 2016.11.0
Use ``options`` instead.
list_options
**For tar archives only.** This state uses :py:func:`archive.list
<salt.modules.archive.list_>` to discover the contents of the source
Expand Down Expand Up @@ -761,21 +749,6 @@ def extracted(name,
)
return ret

tar_options = kwargs.pop('tar_options', None)
zip_options = kwargs.pop('zip_options', None)
if tar_options:
msg = ('The \'tar_options\' argument has been deprecated, please use '
'\'options\' instead.')
salt.utils.warn_until('Oxygen', msg)
ret.setdefault('warnings', []).append(msg)
options = tar_options
elif zip_options:
msg = ('The \'zip_options\' argument has been deprecated, please use '
'\'options\' instead.')
salt.utils.warn_until('Oxygen', msg)
ret.setdefault('warnings', []).append(msg)
options = zip_options

if options is not None and not isinstance(options, six.string_types):
options = str(options)

Expand Down
Loading

0 comments on commit b5179aa

Please sign in to comment.