summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/action
diff options
context:
space:
mode:
authorRukmangathan <kpa.rukmangathan48@gmail.com>2021-05-31 09:48:15 +0530
committerGitHub <noreply@github.com>2021-05-31 09:48:15 +0530
commite0558ac1938e7df5e3070d01567ef80bc4046b1e (patch)
treebe02e577a88d1e020f1601f2755e6e79e9102d22 /lib/ansible/plugins/action
parent5640093f1ca63fd6af231cc8a7fb7d40e1907b8c (diff)
downloadansible-e0558ac1938e7df5e3070d01567ef80bc4046b1e.tar.gz
yum action plugin: 'use' as an alias of 'use_backend' (#70792)
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com> Co-authored-by: rukmangathan <rukmangathan.annadurai@gigamon.com>
Diffstat (limited to 'lib/ansible/plugins/action')
-rw-r--r--lib/ansible/plugins/action/yum.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ansible/plugins/action/yum.py b/lib/ansible/plugins/action/yum.py
index 9d3e145444..d90a9e00cf 100644
--- a/lib/ansible/plugins/action/yum.py
+++ b/lib/ansible/plugins/action/yum.py
@@ -17,6 +17,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
+from ansible.errors import AnsibleActionFail
from ansible.plugins.action import ActionBase
from ansible.utils.display import Display
@@ -47,7 +48,10 @@ class ActionModule(ActionBase):
del tmp # tmp no longer has any effect
# Carry-over concept from the package action plugin
- module = self._task.args.get('use_backend', "auto")
+ if 'use' in self._task.args and 'use_backend' in self._task.args:
+ raise AnsibleActionFail("parameters are mutually exclusive: ('use', 'use_backend')")
+
+ module = self._task.args.get('use', self._task.args.get('use_backend', 'auto'))
if module == 'auto':
try:
@@ -90,6 +94,8 @@ class ActionModule(ActionBase):
new_module_args = self._task.args.copy()
if 'use_backend' in new_module_args:
del new_module_args['use_backend']
+ if 'use' in new_module_args:
+ del new_module_args['use']
display.vvvv("Running %s as the backend for the yum action plugin" % module)
result.update(self._execute_module(