Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible_galaxy_install: minor improvements based on MH updates #4752

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- ansible_galaxy_install - minor refactoring using latest ``ModuleHelper`` updates (https://github.com/ansible-collections/community.general/pull/4752).
6 changes: 3 additions & 3 deletions plugins/modules/packaging/language/ansible_galaxy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class AnsibleGalaxyInstall(CmdModuleHelper):
check_rc = True

def _get_ansible_galaxy_version(self):
ansible_galaxy = self.module.get_bin_path("ansible-galaxy", required=True)
ansible_galaxy = self.get_bin_path("ansible-galaxy", required=True)
dummy, out, dummy = self.module.run_command([ansible_galaxy, "--version"], check_rc=True)
line = out.splitlines()[0]
match = self._RE_GALAXY_VERSION.match(line)
Expand Down Expand Up @@ -302,9 +302,9 @@ def _setup29(self):
self.vars.set("new_roles", {})
self.vars.set("ansible29_change", False, change=True, output=False)
if not (self.vars.ack_ansible29 or self.vars.ack_min_ansiblecore211):
self.module.warn("Ansible 2.9 or older: unable to retrieve lists of roles and collections already installed")
self.warn("Ansible 2.9 or older: unable to retrieve lists of roles and collections already installed")
if self.vars.requirements_file is not None and self.vars.type == 'both':
self.module.warn("Ansible 2.9 or older: will install only roles from requirement files")
self.warn("Ansible 2.9 or older: will install only roles from requirement files")

def _setup210plus(self):
self.vars.set("new_collections", {}, change=True)
Expand Down