diff --git a/changelogs/fragments/4752-ansible-galaxy-install-mh-updates.yml b/changelogs/fragments/4752-ansible-galaxy-install-mh-updates.yml new file mode 100644 index 0000000000..b93d885ed4 --- /dev/null +++ b/changelogs/fragments/4752-ansible-galaxy-install-mh-updates.yml @@ -0,0 +1,2 @@ +minor_changes: + - ansible_galaxy_install - minor refactoring using latest ``ModuleHelper`` updates (https://github.com/ansible-collections/community.general/pull/4752). diff --git a/plugins/modules/packaging/language/ansible_galaxy_install.py b/plugins/modules/packaging/language/ansible_galaxy_install.py index 968a8d093d..7b7ac160da 100644 --- a/plugins/modules/packaging/language/ansible_galaxy_install.py +++ b/plugins/modules/packaging/language/ansible_galaxy_install.py @@ -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) @@ -302,9 +302,9 @@ class AnsibleGalaxyInstall(CmdModuleHelper): 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)