summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndra Machacek <machacek.ondra@gmail.com>2017-03-15 13:04:06 +0100
committerRyan Brown <sb@ryansb.com>2017-03-15 08:04:06 -0400
commit699df5824d36dab5cb46b3f7c63e8992bd778b27 (patch)
treef8620fd0af1b62fcbe074b7e352763ca5dd8d2fa
parentbb7e7be71f81481574f3b5a7f97d61da61baf83d (diff)
downloadansible-699df5824d36dab5cb46b3f7c63e8992bd778b27.tar.gz
cloud: ovirt: fix update_params for ovirt module_utils (#22637)
-rw-r--r--lib/ansible/module_utils/ovirt.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/ovirt.py b/lib/ansible/module_utils/ovirt.py
index 54678f3ccd..2dfd65926e 100644
--- a/lib/ansible/module_utils/ovirt.py
+++ b/lib/ansible/module_utils/ovirt.py
@@ -505,7 +505,15 @@ class BaseModule(object):
return after
- def create(self, entity=None, result_state=None, fail_condition=lambda e: False, search_params=None, **kwargs):
+ def create(
+ self,
+ entity=None,
+ result_state=None,
+ fail_condition=lambda e: False,
+ search_params=None,
+ update_params=None,
+ **kwargs
+ ):
"""
Method which is called when state of the entity is 'present'. If user
don't provide `entity` parameter the entity is searched using
@@ -521,6 +529,7 @@ class BaseModule(object):
:param result_state: State which should entity has in order to finish task.
:param fail_condition: Function which checks incorrect state of entity, if it returns `True` Exception is raised.
:param search_params: Dictionary of parameters to be used for search.
+ :param update_params: The params which should be passed to update method.
:param kwargs: Additional parameters passed when creating entity.
:return: Dictionary with values returned by Ansible module.
"""
@@ -535,7 +544,11 @@ class BaseModule(object):
if not self.update_check(entity):
new_entity = self.build_entity()
if not self._module.check_mode:
- updated_entity = entity_service.update(new_entity)
+ update_params = update_params or {}
+ updated_entity = entity_service.update(
+ new_entity,
+ **update_params
+ )
self.post_update(entity)
# Update diffs only if user specified --diff paramter,