summaryrefslogtreecommitdiffstats
path: root/utils/src
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-02-22 10:49:54 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2016-02-22 10:49:54 -0500
commitcf42fa6038a98065c372d03910bbd36b62f9c2f8 (patch)
tree3eed24c720ff23922b475da231c0bae3e017f9fe /utils/src
parent96858dabbbc7191286847cd4e1a93b9100cafa12 (diff)
parent4a9d7a7c5f75f2bc4099bc7bd06a1d53709ce6af (diff)
downloadopenshift-cf42fa6038a98065c372d03910bbd36b62f9c2f8.tar.gz
openshift-cf42fa6038a98065c372d03910bbd36b62f9c2f8.tar.bz2
openshift-cf42fa6038a98065c372d03910bbd36b62f9c2f8.tar.xz
openshift-cf42fa6038a98065c372d03910bbd36b62f9c2f8.zip
Merge pull request #1450 from smunilla/BZ1308440
a-o-i: Redo logic for detecting master_lb
Diffstat (limited to 'utils/src')
-rw-r--r--utils/src/ooinstall/cli_installer.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index a62bfe134..f09f90288 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -528,18 +528,27 @@ Add new nodes here
def get_installed_hosts(hosts, callback_facts):
installed_hosts = []
+
+ # count nativeha lb as an installed host
+ try:
+ first_master = next(host for host in hosts if host.master)
+ lb_hostname = callback_facts[first_master.connect_to]['master'].get('cluster_hostname', '')
+ lb_host = next(host for host in hosts if host.connect_to == lb_hostname)
+ installed_hosts.append(lb_host)
+ except KeyError:
+ pass
+
+
for host in hosts:
- if host.connect_to in callback_facts.keys() and (
- ('common' in callback_facts[host.connect_to].keys() and
- callback_facts[host.connect_to]['common'].get('version', '') and
- callback_facts[host.connect_to]['common'].get('version', '') != 'None') \
- or
- ('master' in callback_facts[host.connect_to].keys() and
- callback_facts[host.connect_to]['master'].get('cluster_hostname', '') == host.connect_to)
- ):
+ if host.connect_to in callback_facts.keys() and is_installed_host(host, callback_facts):
installed_hosts.append(host)
return installed_hosts
+def is_installed_host(host, callback_facts):
+ return 'common' in callback_facts[host.connect_to].keys() and \
+ callback_facts[host.connect_to]['common'].get('version', '') and \
+ callback_facts[host.connect_to]['common'].get('version', '') != 'None'
+
# pylint: disable=too-many-branches
# This pylint error will be corrected shortly in separate PR.
def get_hosts_to_run_on(oo_cfg, callback_facts, unattended, force, verbose):