From 7ca60e0177b47118ad1687709544085648c8bc17 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Fri, 28 Jan 2022 07:17:06 +0100 Subject: [PATCH] Actually expand ~ in yarn global install folder (#4048) * Fix 'changed' status for yarn global by actually expanding ~ * Ignore use-argspec-type-path test * Add changelog fragment * Update changelogs/fragments/4048-expand-tilde-in-yarn-global-install-folder.yaml Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein --- .../4048-expand-tilde-in-yarn-global-install-folder.yaml | 2 ++ plugins/modules/packaging/language/yarn.py | 2 +- tests/sanity/ignore-2.10.txt | 1 + tests/sanity/ignore-2.11.txt | 1 + tests/sanity/ignore-2.12.txt | 1 + tests/sanity/ignore-2.13.txt | 1 + tests/sanity/ignore-2.9.txt | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/4048-expand-tilde-in-yarn-global-install-folder.yaml diff --git a/changelogs/fragments/4048-expand-tilde-in-yarn-global-install-folder.yaml b/changelogs/fragments/4048-expand-tilde-in-yarn-global-install-folder.yaml new file mode 100644 index 0000000000..43e062e7c3 --- /dev/null +++ b/changelogs/fragments/4048-expand-tilde-in-yarn-global-install-folder.yaml @@ -0,0 +1,2 @@ +bugfixes: + - yarn - fix missing ``~`` expansion in yarn global install folder which resulted in incorrect task status (https://github.com/ansible-collections/community.general/issues/4045, https://github.com/ansible-collections/community.general/pull/4048). diff --git a/plugins/modules/packaging/language/yarn.py b/plugins/modules/packaging/language/yarn.py index 442b3b8b6f..7df043c279 100644 --- a/plugins/modules/packaging/language/yarn.py +++ b/plugins/modules/packaging/language/yarn.py @@ -163,7 +163,7 @@ from ansible.module_utils.basic import AnsibleModule class Yarn(object): - DEFAULT_GLOBAL_INSTALLATION_PATH = '~/.config/yarn/global' + DEFAULT_GLOBAL_INSTALLATION_PATH = os.path.expanduser('~/.config/yarn/global') def __init__(self, module, **kwargs): self.module = module diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 12d04cc8f9..4d5d390380 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -24,6 +24,7 @@ plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 +plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew_cask.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 7458ce868a..ee0ae9beb4 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -23,6 +23,7 @@ plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 +plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew_cask.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 9e202db851..572451ae21 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -18,6 +18,7 @@ plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 +plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew_cask.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 9e202db851..572451ae21 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -18,6 +18,7 @@ plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/clustering/consul/consul_session.py validate-modules:parameter-state-invalid-choice plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 +plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew_cask.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 846d682edb..dc5d2fcb72 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -18,6 +18,7 @@ plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undo plugins/modules/clustering/consul/consul.py validate-modules:doc-missing-type plugins/modules/clustering/consul/consul.py validate-modules:undocumented-parameter plugins/modules/packaging/language/composer.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 +plugins/modules/packaging/language/yarn.py use-argspec-type-path plugins/modules/packaging/os/apt_rpm.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0 plugins/modules/packaging/os/homebrew_cask.py validate-modules:parameter-invalid # invalid alias - removed in 5.0.0