summaryrefslogtreecommitdiffstats
path: root/utils/test/fixture.py
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2015-11-27 11:31:35 -0400
committerDevan Goodwin <dgoodwin@redhat.com>2015-11-30 15:02:07 -0400
commit4872c5e1d298cba9901e2ecf207580b7d4fdece7 (patch)
tree0a172b65c7f6acd0bf655c0b1801d0b97cd87148 /utils/test/fixture.py
parent94ce712e8e0ebeec4b0c27c6b9b26f03a26a1fd5 (diff)
downloadopenshift-4872c5e1d298cba9901e2ecf207580b7d4fdece7.tar.gz
openshift-4872c5e1d298cba9901e2ecf207580b7d4fdece7.tar.bz2
openshift-4872c5e1d298cba9901e2ecf207580b7d4fdece7.tar.xz
openshift-4872c5e1d298cba9901e2ecf207580b7d4fdece7.zip
Adjust requirement for 3 masters for HA deployments.
If only 2 masters are specified, consider this a configuration error if running an unattended install, and prevent it completely if running an attended install. (continues to prompt for hosts until you have at least 3) Because this condition cannot be entered in the interactive install, we can't really write a test for this negative case.
Diffstat (limited to 'utils/test/fixture.py')
-rw-r--r--utils/test/fixture.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/utils/test/fixture.py b/utils/test/fixture.py
index ab1c3f12e..14baec6b3 100644
--- a/utils/test/fixture.py
+++ b/utils/test/fixture.py
@@ -54,7 +54,7 @@ class OOCliFixture(OOInstallFixture):
return self.runner.invoke(cli.cli, self.cli_args)
def assert_result(self, result, exit_code):
- if result.exception is not None or result.exit_code != exit_code:
+ if result.exit_code != exit_code:
print "Unexpected result from CLI execution"
print "Exit code: %s" % result.exit_code
print "Exception: %s" % result.exception
@@ -163,7 +163,6 @@ def build_input(ssh_user=None, hosts=None, variant_num=None,
num_masters = 0
if hosts:
i = 0
- min_masters_for_ha = 3
for (host, is_master) in hosts:
inputs.append(host)
if is_master:
@@ -172,11 +171,15 @@ def build_input(ssh_user=None, hosts=None, variant_num=None,
else:
inputs.append('n')
#inputs.append('rpm')
- if i < len(hosts) - 1:
- if num_masters <= 1 or num_masters >= min_masters_for_ha:
- inputs.append('y') # Add more hosts
- else:
- inputs.append('n') # Done adding hosts
+ # We should not be prompted to add more hosts if we're currently at
+ # 2 masters, this is an invalid HA configuration, so this question
+ # will not be asked, and the user must enter the next host:
+ if num_masters != 2:
+ if i < len(hosts) - 1:
+ if num_masters >= 1:
+ inputs.append('y') # Add more hosts
+ else:
+ inputs.append('n') # Done adding hosts
i += 1
# You can pass a single master_lb or a list if you intend for one to get rejected: