From b1479e0f4c2ded50fc68a435b6271a5acbec10e4 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Wed, 23 Mar 2016 14:59:18 -0300 Subject: Add --gen-inventory command to atomic-openshift-installer. This will just generate the Ansible inventory once all information is gathered, inform the user where to find it, and exit. Includes some test utility updates to make what broke as a result of this change less fragile. --- utils/test/fixture.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'utils/test/fixture.py') diff --git a/utils/test/fixture.py b/utils/test/fixture.py index d6222dfaa..eb94418c2 100644 --- a/utils/test/fixture.py +++ b/utils/test/fixture.py @@ -81,8 +81,8 @@ class OOCliFixture(OOInstallFixture): def _verify_run_playbook(self, run_playbook_mock, exp_hosts_len, exp_hosts_to_run_on_len): """ Check that we ran playbook with expected inputs. """ - hosts = run_playbook_mock.call_args[0][0] - hosts_to_run_on = run_playbook_mock.call_args[0][1] + hosts = run_playbook_mock.call_args[0][1] + hosts_to_run_on = run_playbook_mock.call_args[0][2] self.assertEquals(exp_hosts_len, len(hosts)) self.assertEquals(exp_hosts_to_run_on_len, len(hosts_to_run_on)) @@ -133,8 +133,8 @@ class OOCliFixture(OOInstallFixture): self._verify_run_playbook(run_playbook_mock, exp_hosts_len, exp_hosts_to_run_on_len) # Make sure we ran on the expected masters and nodes: - hosts = run_playbook_mock.call_args[0][0] - hosts_to_run_on = run_playbook_mock.call_args[0][1] + hosts = run_playbook_mock.call_args[0][1] + hosts_to_run_on = run_playbook_mock.call_args[0][2] self.assertEquals(exp_hosts_len, len(hosts)) self.assertEquals(exp_hosts_to_run_on_len, len(hosts_to_run_on)) -- cgit v1.2.3 From 67d4685ef8885ff3ee759f5a36d9c97ba2012c50 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Thu, 24 Mar 2016 08:51:01 -0300 Subject: Write inventory to same directory as quick install config. With the addition of a --gen-inventory flag and always displaying the location of the inventory written to disk, we should write the hosts file to a more prominent location rather than a hidden directory. --- utils/test/fixture.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/test/fixture.py') diff --git a/utils/test/fixture.py b/utils/test/fixture.py index eb94418c2..1657d8f46 100644 --- a/utils/test/fixture.py +++ b/utils/test/fixture.py @@ -68,7 +68,7 @@ class OOCliFixture(OOInstallFixture): def _verify_load_facts(self, load_facts_mock): """ Check that we ran load facts with expected inputs. """ load_facts_args = load_facts_mock.call_args[0] - self.assertEquals(os.path.join(self.work_dir, ".ansible/hosts"), + self.assertEquals(os.path.join(self.work_dir, "hosts"), load_facts_args[0]) self.assertEquals(os.path.join(self.work_dir, "playbooks/byo/openshift_facts.yml"), -- cgit v1.2.3