From 273a678771cb526af1c5de2935ad9c338638bf87 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 30 Mar 2020 22:45:17 +0530 Subject: [PATCH] homebrew_cask: Follow up changes (#32) Follow up changes recommended in code review Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/34696-homebrew_cask.yml | 2 ++ plugins/modules/packaging/os/homebrew_cask.py | 25 +++++++++++-------- tests/sanity/ignore-2.10.txt | 3 --- 3 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 changelogs/fragments/34696-homebrew_cask.yml diff --git a/changelogs/fragments/34696-homebrew_cask.yml b/changelogs/fragments/34696-homebrew_cask.yml new file mode 100644 index 0000000000..f15495ebed --- /dev/null +++ b/changelogs/fragments/34696-homebrew_cask.yml @@ -0,0 +1,2 @@ +minor_changes: +- Follow up changes in homebrew_cask (https://github.com/ansible/ansible/issues/34696). diff --git a/plugins/modules/packaging/os/homebrew_cask.py b/plugins/modules/packaging/os/homebrew_cask.py index 19687da12f..26c0843170 100644 --- a/plugins/modules/packaging/os/homebrew_cask.py +++ b/plugins/modules/packaging/os/homebrew_cask.py @@ -26,16 +26,16 @@ author: - "Enric Lluelles (@enriclluelles)" requirements: - "python >= 2.6" -short_description: Install and uninstall homebrew casks. +short_description: Install and uninstall homebrew casks description: - Manages Homebrew casks. options: name: description: - Name of cask to install or remove. - required: true - aliases: ['pkg', 'package', 'cask'] + aliases: [ 'cask', 'package', 'pkg' ] type: list + elements: str path: description: - "':' separated list of paths to search for 'brew' executable." @@ -44,7 +44,7 @@ options: state: description: - State of the cask. - choices: [ 'present', 'absent', 'upgraded' ] + choices: [ 'absent', 'installed', 'latest', 'present', 'removed', 'uninstalled', 'upgraded' ] default: present type: str sudo_password: @@ -57,32 +57,33 @@ options: - Update homebrew itself first. - Note that C(brew cask update) is a synonym for C(brew update). type: bool - default: 'no' - aliases: ['update-brew'] + default: no + aliases: [ 'update-brew' ] install_options: description: - Options flags to install a package. - aliases: ['options'] + aliases: [ 'options' ] type: list + elements: str accept_external_apps: description: - Allow external apps. type: bool - default: 'no' + default: no upgrade_all: description: - Upgrade all casks. - Mutually exclusive with C(upgraded) state. type: bool - default: 'no' - aliases: ['upgrade'] + default: no + aliases: [ 'upgrade' ] greedy: description: - Upgrade casks that auto update. - Passes --greedy to brew cask outdated when checking if an installed cask has a newer version available. type: bool - default: 'no' + default: no ''' EXAMPLES = ''' - name: Install cask @@ -749,6 +750,7 @@ def main(): aliases=["pkg", "package", "cask"], required=False, type='list', + elements='str', ), path=dict( default="/usr/local/bin", @@ -777,6 +779,7 @@ def main(): default=None, aliases=['options'], type='list', + elements='str', ), accept_external_apps=dict( default=False, diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index bda7b2e1b8..e366f581af 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -2974,10 +2974,7 @@ plugins/modules/packaging/os/flatpak.py validate-modules:use-run-command-not-pop plugins/modules/packaging/os/flatpak_remote.py validate-modules:parameter-type-not-in-doc plugins/modules/packaging/os/flatpak_remote.py validate-modules:use-run-command-not-popen plugins/modules/packaging/os/homebrew.py validate-modules:parameter-invalid -plugins/modules/packaging/os/homebrew_cask.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/packaging/os/homebrew_cask.py validate-modules:doc-required-mismatch plugins/modules/packaging/os/homebrew_cask.py validate-modules:parameter-invalid -plugins/modules/packaging/os/homebrew_cask.py validate-modules:parameter-list-no-elements plugins/modules/packaging/os/installp.py validate-modules:parameter-list-no-elements plugins/modules/packaging/os/layman.py validate-modules:doc-missing-type plugins/modules/packaging/os/layman.py validate-modules:undocumented-parameter