From ffb02cfb550a0ebf4ab88e9241a8d42bc17751a4 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 25 Aug 2016 23:20:04 -0500 Subject: [PATCH] Fix assumption that the main OSA inventory will be used The role base test use a much simplified inventory which this plugin was not accounting for. This resolves the assumption. Change-Id: I995b62cbf825f15a93e3bb44f48b3527c9e5ba48 Signed-off-by: Kevin Carter --- strategy/linear.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/strategy/linear.py b/strategy/linear.py index b4a9959..2065cef 100644 --- a/strategy/linear.py +++ b/strategy/linear.py @@ -130,21 +130,21 @@ class StrategyModule(LINEAR.StrategyModule): caplevel=0 ) else: - if 'physical_host' in task_vars: - physical_host = _vars.get('physical_host') - if not physical_host: - physical_host = task_vars.get('physical_host') - if physical_host: - ph = self._inventory.get_host(physical_host) - _vars['physical_host'] = ph.vars['ansible_ssh_host'] + physical_host = _vars.get('physical_host') + if not physical_host: + physical_host = task_vars.get('physical_host') + if physical_host: + ph = self._inventory.get_host(physical_host) + ansible_ssh_host = ph.vars.get('ansible_ssh_host') + if ansible_ssh_host: + _vars['physical_host'] = ansible_ssh_host _vars['physical_hostname'] = physical_host - if 'container_name' in task_vars: - container_name = _vars.get('container_name') - if not container_name: - container_name = task_vars.get('container_name') - if container_name: - _vars['container_name'] = task_vars['container_name'] + container_name = _vars.get('container_name') + if not container_name: + container_name = task_vars.get('container_name') + if container_name: + _vars['container_name'] = container_name return super(StrategyModule, self)._queue_task( host,