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 <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-08-25 23:20:04 -05:00
parent 2b38db1e1c
commit ffb02cfb55
No known key found for this signature in database
GPG Key ID: 69FEFFC5E2D9273F

View File

@ -130,21 +130,21 @@ class StrategyModule(LINEAR.StrategyModule):
caplevel=0 caplevel=0
) )
else: else:
if 'physical_host' in task_vars: physical_host = _vars.get('physical_host')
physical_host = _vars.get('physical_host') if not physical_host:
if not physical_host: physical_host = task_vars.get('physical_host')
physical_host = task_vars.get('physical_host') if physical_host:
if physical_host: ph = self._inventory.get_host(physical_host)
ph = self._inventory.get_host(physical_host) ansible_ssh_host = ph.vars.get('ansible_ssh_host')
_vars['physical_host'] = ph.vars['ansible_ssh_host'] if ansible_ssh_host:
_vars['physical_host'] = ansible_ssh_host
_vars['physical_hostname'] = physical_host _vars['physical_hostname'] = physical_host
if 'container_name' in task_vars: container_name = _vars.get('container_name')
container_name = _vars.get('container_name') if not container_name:
if not container_name: container_name = task_vars.get('container_name')
container_name = task_vars.get('container_name') if container_name:
if container_name: _vars['container_name'] = container_name
_vars['container_name'] = task_vars['container_name']
return super(StrategyModule, self)._queue_task( return super(StrategyModule, self)._queue_task(
host, host,