diff options
author | Tim Bielawa <timbielawa@gmail.com> | 2016-11-02 10:08:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-02 10:08:50 -0700 |
commit | a2076029c955d63fb4416f435f67b1caab96883c (patch) | |
tree | e6d8e23140d3028bf20af948542519cfb3416251 | |
parent | 0ddc73e7b6b7e4ea8e339b53d665ed6125b1496b (diff) | |
parent | 3ce7d25475886fc708254ee1884285e3b15ed6d3 (diff) | |
download | openshift-a2076029c955d63fb4416f435f67b1caab96883c.tar.gz openshift-a2076029c955d63fb4416f435f67b1caab96883c.tar.bz2 openshift-a2076029c955d63fb4416f435f67b1caab96883c.tar.xz openshift-a2076029c955d63fb4416f435f67b1caab96883c.zip |
Merge pull request #2697 from tbielawa/BZ1390064
Consider lb/preconfigured hosts when verifying mixed environments
-rw-r--r-- | utils/src/ooinstall/cli_installer.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index a253a1f03..32da3f663 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -675,8 +675,10 @@ def get_installed_hosts(hosts, callback_facts): for host in [h for h in hosts if h.is_master() or h.is_node()]: if host.connect_to in callback_facts.keys(): if is_installed_host(host, callback_facts): + INSTALLER_LOG.debug("%s is already installed", str(host)) installed_hosts.append(host) else: + INSTALLER_LOG.debug("%s is not installed", str(host)) uninstalled_hosts.append(host) return installed_hosts, uninstalled_hosts @@ -709,6 +711,17 @@ def get_hosts_to_run_on(oo_cfg, callback_facts, unattended, force): installed_hosts, uninstalled_hosts = get_installed_hosts(oo_cfg.deployment.hosts, callback_facts) nodes = [host for host in oo_cfg.deployment.hosts if host.is_node()] + not_balancers = [host for host in oo_cfg.deployment.hosts if not host.is_master_lb()] + + in_hosts = [str(h) for h in installed_hosts] + un_hosts = [str(h) for h in uninstalled_hosts] + all_hosts = [str(h) for h in oo_cfg.deployment.hosts] + no_bals = [str(h) for h in not_balancers] + + INSTALLER_LOG.debug("installed hosts: %s", ", ".join(in_hosts)) + INSTALLER_LOG.debug("uninstalled hosts: %s", ", ".join(un_hosts)) + INSTALLER_LOG.debug("deployment hosts: %s", ", ".join(all_hosts)) + INSTALLER_LOG.debug("not balancers: %s", ", ".join(no_bals)) # Case (1): All uninstalled hosts if len(uninstalled_hosts) == len(nodes): @@ -716,7 +729,7 @@ def get_hosts_to_run_on(oo_cfg, callback_facts, unattended, force): hosts_to_run_on = list(oo_cfg.deployment.hosts) else: # Case (2): All installed hosts - if len(installed_hosts) == len(list(oo_cfg.deployment.hosts)): + if len(installed_hosts) == len(not_balancers): message = """ All specified hosts in specified environment are installed. """ @@ -727,6 +740,16 @@ A mix of installed and uninstalled hosts have been detected in your environment. Please make sure your environment was installed successfully before adding new nodes. """ + # Still inside the case 2/3 else condition + mixed_msg = """ +\tInstalled hosts: +\t\t{inst_hosts} + +\tUninstalled hosts: +\t\t{uninst_hosts}""".format(inst_hosts=", ".join(in_hosts), uninst_hosts=", ".join(un_hosts)) + click.echo(mixed_msg) + + # Out of the case 2/3 if/else click.echo(message) if not unattended: |