Skip to content

Commit

Permalink
ansible_galaxy_install: minor improvements based on MH updates (#4752)
Browse files Browse the repository at this point in the history
* ansible_galaxy_install: minor improvements based on MH updates

* added changelog fragment

(cherry picked from commit d019e22)
  • Loading branch information
russoz authored and patchback[bot] committed Jun 4, 2022
1 parent d4330a3 commit 507fb2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit 507fb2c

Please sign in to comment.