Merge "Remove configs parameter from TripleoInventory"

This commit is contained in:
Zuul 2018-11-15 21:08:37 +00:00 committed by Gerrit Code Review
commit 162ec7c171
3 changed files with 14 additions and 35 deletions

View File

@ -0,0 +1,6 @@
---
other:
- |
TripleoInventory class no longer supports the parameters being passed in as
as config object. This was added to support transition in in
tripleo-validations that was corrected in Queens.

View File

@ -83,7 +83,7 @@ class StackOutputs(object):
class TripleoInventory(object):
def __init__(self, configs=None, session=None, hclient=None,
def __init__(self, session=None, hclient=None,
plan_name=None, auth_url=None, project_name=None,
cacert=None, username=None, ansible_ssh_user=None,
host_network=None, ansible_python_interpreter=None):
@ -91,25 +91,13 @@ class TripleoInventory(object):
self.hclient = hclient
self.hosts_format_dict = False
self.host_network = host_network or HOST_NETWORK
if configs is not None:
# FIXME(shardy) backwards compatibility until we switch
# tripleo-validations to pass the individual values
self.auth_url = configs.auth_url
self.cacert = configs.cacert
self.project_name = configs.project_name
self.username = configs.username
self.ansible_ssh_user = configs.ansible_ssh_user
self.plan_name = configs.plan
self.ansible_python_interpreter = \
configs.ansible_python_interpreter
else:
self.auth_url = auth_url
self.cacert = cacert
self.project_name = project_name
self.username = username
self.ansible_ssh_user = ansible_ssh_user
self.plan_name = plan_name
self.ansible_python_interpreter = ansible_python_interpreter
self.auth_url = auth_url
self.cacert = cacert
self.project_name = project_name
self.username = username
self.ansible_ssh_user = ansible_ssh_user
self.plan_name = plan_name
self.ansible_python_interpreter = ansible_python_interpreter
self.stack_outputs = StackOutputs(self.plan_name, self.hclient)
self.hostvars = {}

View File

@ -171,21 +171,6 @@ class TestInventory(base.TestCase):
def test_inventory_list(self):
self._inventory_list(self.inventory)
def test_inventory_list_backwards_compat_configs(self):
# FIXME(shardy) backwards compatibility until we switch
# tripleo-validations to pass the individual values
configs = MagicMock()
configs.plan = self.plan_name
configs.auth_url = 'xyz://keystone.local'
configs.cacert = 'acacert'
configs.project_name = 'admin'
configs.username = 'admin'
configs.ansible_ssh_user = 'heat-admin'
configs.ansible_python_interpreter = None
inventory = TripleoInventory(
configs, self.session, self.hclient)
self._inventory_list(inventory)
def _inventory_list(self, inventory):
ansible_ssh_user = 'heat-admin'
expected = {