summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2018-03-23 18:59:54 -0700
committerJulia Kreger <juliaashleykreger@gmail.com>2018-03-28 12:10:14 -0700
commit22efd5de5478676fc643a534ab52360f20eb968a (patch)
tree90659da3a15af4903f9f24aeee2938b503c0581b
parentef089271479ea65fc3200cd9e2bbe69a3d004e07 (diff)
downloadironic-22efd5de5478676fc643a534ab52360f20eb968a.tar.gz
Fix callback plugin for Ansible 2.5 compatability
Ansible 2.5 changed an internal callback method around that is expected in plugins for options. In order for this to work, we needed to make some minor changes. Change-Id: I3801f339511155a4b8ecab91bb06b286b11c0a06 Related-Bug: #1758462 (cherry picked from commit 3631fd4791dd13977e446ee8445dbd1225d890bc)
-rw-r--r--driver-requirements.txt2
-rw-r--r--ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py10
2 files changed, 8 insertions, 4 deletions
diff --git a/driver-requirements.txt b/driver-requirements.txt
index e825b32d8..643546333 100644
--- a/driver-requirements.txt
+++ b/driver-requirements.txt
@@ -22,4 +22,4 @@ ImcSdk>=0.7.2
sushy
# Ansible-deploy interface
-ansible>=2.4,<2.5.0
+ansible>=2.4
diff --git a/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py b/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py
index 55fa5b834..e3fb9d3ef 100644
--- a/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py
+++ b/ironic/drivers/modules/ansible/playbooks/callback_plugins/ironic_log.py
@@ -85,13 +85,17 @@ class CallbackModule(object):
setup_log()
self.log = logging.getLogger(__name__)
self.node = None
- self.opts = {}
+ self._plugin_options = {}
# NOTE(pas-ha) this method is required for Ansible>=2.4
# TODO(pas-ha) rewrite to support defining callback plugin options
# in ansible.cfg after we require Ansible >=2.4
- def set_options(self, options):
- self.opts = options
+ def set_options(self, option=None, option_value=None):
+ if option:
+ if option_value:
+ self._plugin_options[option] = option_value
+ else:
+ self._plugin_options = option
def runner_msg_dict(self, result):
self.node = result._host.get_name()