From 037950923abd5188977e825d994f14111b0e6a89 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Mon, 16 Nov 2015 12:03:47 -0400 Subject: Fix tests on systems with openshift-ansible rpms installed. --- utils/src/ooinstall/cli_installer.py | 3 ++- utils/test/cli_installer_tests.py | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index 3c3f45c3b..3b5dbaf0e 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -458,7 +458,8 @@ def cli(ctx, unattended, configuration, ansible_playbook_directory, ansible_conf if ctx.obj['ansible_config']: oo_cfg.settings['ansible_config'] = ctx.obj['ansible_config'] - elif os.path.exists(DEFAULT_ANSIBLE_CONFIG): + elif 'ansible_config' not in oo_cfg.settings and \ + os.path.exists(DEFAULT_ANSIBLE_CONFIG): # If we're installed by RPM this file should exist and we can use it as our default: oo_cfg.settings['ansible_config'] = DEFAULT_ANSIBLE_CONFIG diff --git a/utils/test/cli_installer_tests.py b/utils/test/cli_installer_tests.py index fc16d9ceb..baadad358 100644 --- a/utils/test/cli_installer_tests.py +++ b/utils/test/cli_installer_tests.py @@ -284,7 +284,9 @@ class UnattendedCliTests(OOCliFixture): '.ansible/callback_facts.yaml'), env_vars['OO_INSTALL_CALLBACK_FACTS_YAML']) self.assertEqual('/tmp/ansible.log', env_vars['ANSIBLE_LOG_PATH']) - self.assertTrue('ANSIBLE_CONFIG' not in env_vars) + # If user running test has rpm installed, this might be set to default: + self.assertTrue('ANSIBLE_CONFIG' not in env_vars or + env_vars['ANSIBLE_CONFIG'] == cli.DEFAULT_ANSIBLE_CONFIG) # Make sure we ran on the expected masters and nodes: hosts = run_playbook_mock.call_args[0][0] @@ -450,14 +452,18 @@ class UnattendedCliTests(OOCliFixture): if expected_result: self.assertEquals(expected_result, facts_env_vars['ANSIBLE_CONFIG']) else: - self.assertFalse('ANSIBLE_CONFIG' in facts_env_vars) + # If user running test has rpm installed, this might be set to default: + self.assertTrue('ANSIBLE_CONFIG' not in facts_env_vars or + facts_env_vars['ANSIBLE_CONFIG'] == cli.DEFAULT_ANSIBLE_CONFIG) # Test the env vars for main playbook: env_vars = run_ansible_mock.call_args[0][2] if expected_result: self.assertEquals(expected_result, env_vars['ANSIBLE_CONFIG']) else: - self.assertFalse('ANSIBLE_CONFIG' in env_vars) + # If user running test has rpm installed, this might be set to default: + self.assertTrue('ANSIBLE_CONFIG' not in env_vars or + env_vars['ANSIBLE_CONFIG'] == cli.DEFAULT_ANSIBLE_CONFIG) class AttendedCliTests(OOCliFixture): -- cgit v1.2.3 From 77e9ebdc9c576015c886ed31ae26b693a9eace91 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Mon, 16 Nov 2015 12:19:01 -0400 Subject: Default to installing OSE 3.1 instead of 3.0. --- utils/src/ooinstall/cli_installer.py | 1 + utils/src/ooinstall/variants.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index 3b5dbaf0e..daffe4aea 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -205,6 +205,7 @@ def get_variant_and_version(): message = "%s\n(%s) %s %s" % (message, i, variant.description, version.name) i = i + 1 + message = "%s\n" % message click.echo(message) response = click.prompt("Choose a variant from above: ", default=1) diff --git a/utils/src/ooinstall/variants.py b/utils/src/ooinstall/variants.py index 3bb61dddb..571025543 100644 --- a/utils/src/ooinstall/variants.py +++ b/utils/src/ooinstall/variants.py @@ -30,14 +30,14 @@ class Variant(object): self.versions = versions def latest_version(self): - return self.versions[-1] + return self.versions[0] # WARNING: Keep the versions ordered, most recent last: OSE = Variant('openshift-enterprise', 'OpenShift Enterprise', [ - Version('3.0', 'enterprise'), - Version('3.1', 'openshift-enterprise') + Version('3.1', 'openshift-enterprise'), + Version('3.0', 'enterprise') ] ) -- cgit v1.2.3 From c6b7ba8b0017af0875bd912ad0e83fb3d5879591 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Mon, 16 Nov 2015 12:53:03 -0400 Subject: Pylint fix for long line in cli docstring. --- utils/src/ooinstall/cli_installer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index daffe4aea..a19c19c8f 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -432,7 +432,8 @@ def get_hosts_to_run_on(oo_cfg, callback_facts, unattended, force, verbose): # Main CLI entrypoint, not much we can do about too many arguments. def cli(ctx, unattended, configuration, ansible_playbook_directory, ansible_config, ansible_log_path, verbose): """ - atomic-openshift-installer makes the process for installing OSE or AEP easier by interactively gathering the data needed to run on each host. + atomic-openshift-installer makes the process for installing OSE or AEP + easier by interactively gathering the data needed to run on each host. It can also be run in unattended mode if provided with a configuration file. Further reading: https://docs.openshift.com/enterprise/latest/install_config/install/quick_install.html -- cgit v1.2.3