From fe57cd5ac8c95ebdbe214ed0992e3ed38c28cc99 Mon Sep 17 00:00:00 2001 From: Benoit Vaudel Date: Mon, 10 Jan 2022 07:08:17 +0100 Subject: [PATCH] puppet: Add documentation and remove deprecation for show_diff, keep deprecation for alias show-diff (#3980) * puppet: Add documentation and remove deprecation for show_diff * Add changelog fragment * Update changelogs/fragments/3980-puppet-show_diff.yml Co-authored-by: Felix Fontein * Update plugins/modules/system/puppet.py Co-authored-by: Felix Fontein * Update plugins/modules/system/puppet.py Co-authored-by: Felix Fontein * Fixing syntax error introduced in 29298da3 * More documentation for show_diff and fix some sanity errors * Update changelogs/fragments/3980-puppet-show_diff.yml Co-authored-by: Felix Fontein * Update tests/sanity/ignore-2.10.txt Co-authored-by: Felix Fontein * Add validate-modules:parameter-invalid to ignores due to invalid and depricated alias * Keep use-argspec-type-path in ignores * Update plugins/modules/system/puppet.py Co-authored-by: Felix Fontein Co-authored-by: Benoit Vaudel Co-authored-by: Felix Fontein --- changelogs/fragments/3980-puppet-show_diff.yml | 2 ++ plugins/modules/system/puppet.py | 10 +++++++++- tests/sanity/ignore-2.10.txt | 3 +-- tests/sanity/ignore-2.11.txt | 3 +-- tests/sanity/ignore-2.12.txt | 3 +-- tests/sanity/ignore-2.13.txt | 3 +-- tests/sanity/ignore-2.9.txt | 2 +- 7 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 changelogs/fragments/3980-puppet-show_diff.yml diff --git a/changelogs/fragments/3980-puppet-show_diff.yml b/changelogs/fragments/3980-puppet-show_diff.yml new file mode 100644 index 0000000000..1428245be7 --- /dev/null +++ b/changelogs/fragments/3980-puppet-show_diff.yml @@ -0,0 +1,2 @@ +minor_changes: + - puppet - remove deprecation for ``show_diff`` parameter. Its alias ``show-diff`` is still deprecated and will be removed in community.general 7.0.0 (https://github.com/ansible-collections/community.general/pull/3980). diff --git a/plugins/modules/system/puppet.py b/plugins/modules/system/puppet.py index b83ef89aa5..ed7341cb94 100644 --- a/plugins/modules/system/puppet.py +++ b/plugins/modules/system/puppet.py @@ -92,6 +92,13 @@ options: - Enable full debugging. type: bool default: false + show_diff: + description: + - Whether to print file changes details + - Alias C(show-diff) has been deprecated and will be removed in community.general 7.0.0. + aliases: ['show-diff'] + type: bool + default: false requirements: - puppet author: @@ -174,9 +181,10 @@ def main(): manifest=dict(type='str'), noop=dict(type='bool'), logdest=dict(type='str', default='stdout', choices=['all', 'stdout', 'syslog']), + # The following is not related to Ansible's diff; see https://github.com/ansible-collections/community.general/pull/3980#issuecomment-1005666154 show_diff=dict( type='bool', default=False, aliases=['show-diff'], - removed_in_version='7.0.0', removed_from_collection='community.general'), + deprecated_aliases=[dict(name='show-diff', version='7.0.0', collection_name='community.general')]), facts=dict(type='dict'), facter_basename=dict(type='str', default='ansible'), environment=dict(type='str'), diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 0f006e2723..12d04cc8f9 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -48,8 +48,7 @@ plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented -plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc +plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:return-syntax-error diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 45d343f785..7458ce868a 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -47,8 +47,7 @@ plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented -plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc +plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:return-syntax-error diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 1654a4aa15..9e202db851 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -42,8 +42,7 @@ plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented -plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc +plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:return-syntax-error diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 1654a4aa15..9e202db851 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -42,8 +42,7 @@ plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/osx_defaults.py validate-modules:parameter-state-invalid-choice plugins/modules/system/parted.py validate-modules:parameter-state-invalid-choice plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:doc-default-does-not-match-spec # show_diff is not documented -plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc +plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/xfconf.py validate-modules:parameter-state-invalid-choice # state get removed in 5.0.0 plugins/modules/system/xfconf.py validate-modules:return-syntax-error diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index f67aa96d78..846d682edb 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -37,7 +37,7 @@ plugins/modules/remote_management/manageiq/manageiq_provider.py validate-modules plugins/modules/source_control/github/github_deploy_key.py validate-modules:parameter-invalid plugins/modules/system/iptables_state.py validate-modules:undocumented-parameter plugins/modules/system/puppet.py use-argspec-type-path -plugins/modules/system/puppet.py validate-modules:parameter-type-not-in-doc +plugins/modules/system/puppet.py validate-modules:parameter-invalid # invalid alias - removed in 7.0.0 plugins/modules/system/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/system/xfconf.py validate-modules:return-syntax-error plugins/modules/web_infrastructure/jenkins_plugin.py use-argspec-type-path