From b606078d69acdbc0d73fd7a4f47e492def4bb53c Mon Sep 17 00:00:00 2001 From: Ondra Machacek Date: Thu, 24 Nov 2016 17:03:22 +0100 Subject: [PATCH] Add param method to oVirt helper module (#18605) This patch add new param method to fetch parameters from the Ansible module, so modules don't have to use the long name `self._module.params.get()`. --- lib/ansible/module_utils/ovirt.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/module_utils/ovirt.py b/lib/ansible/module_utils/ovirt.py index adf928b6e3e..4808e1ddab8 100644 --- a/lib/ansible/module_utils/ovirt.py +++ b/lib/ansible/module_utils/ovirt.py @@ -327,6 +327,12 @@ class BaseModule(object): """ pass + def param(self, name, default=None): + """ + Return a module parameter specified by it's name. + """ + return self._module.params.get(name, default) + def update_check(self, entity): """ This method handle checks whether the entity values are same as values