summaryrefslogtreecommitdiffstats
path: root/utils/src
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-08-10 15:17:28 -0400
committerGitHub <noreply@github.com>2016-08-10 15:17:28 -0400
commit522cccbc7fd119a182a44af8fb2c0959d919a093 (patch)
tree1a5046548608a37e4f9b92b9d38eb264b2539e62 /utils/src
parent1655e306fb27be7b6d8a07587b5cdbf71cdb9bb2 (diff)
parent8fbd4447a22d1cdf9b2bd9ef3687d0eb3d67285b (diff)
downloadopenshift-522cccbc7fd119a182a44af8fb2c0959d919a093.tar.gz
openshift-522cccbc7fd119a182a44af8fb2c0959d919a093.tar.bz2
openshift-522cccbc7fd119a182a44af8fb2c0959d919a093.tar.xz
openshift-522cccbc7fd119a182a44af8fb2c0959d919a093.zip
Merge pull request #2062 from smunilla/BZ1329455
a-o-i: Restrict installed host check
Diffstat (limited to 'utils/src')
-rw-r--r--utils/src/ooinstall/cli_installer.py37
1 files changed, 18 insertions, 19 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index 67eeb97bc..bc15e41d5 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -16,6 +16,21 @@ from ooinstall.variants import find_variant, get_variant_version_combos
DEFAULT_ANSIBLE_CONFIG = '/usr/share/atomic-openshift-utils/ansible.cfg'
DEFAULT_PLAYBOOK_DIR = '/usr/share/ansible/openshift-ansible/'
+UPGRADE_MAPPINGS = {
+ '3.0':{
+ 'minor_version' :'3.0',
+ 'minor_playbook':'v3_0_minor/upgrade.yml',
+ 'major_version' :'3.1',
+ 'major_playbook':'v3_0_to_v3_1/upgrade.yml',
+ },
+ '3.1':{
+ 'minor_version' :'3.1',
+ 'minor_playbook':'v3_1_minor/upgrade.yml',
+ 'major_playbook':'v3_1_to_v3_2/upgrade.yml',
+ 'major_version' :'3.2',
+ }
+ }
+
def validate_ansible_dir(path):
if not path:
raise click.BadParameter('An ansible path must be provided')
@@ -655,7 +670,7 @@ def get_installed_hosts(hosts, callback_facts):
except (KeyError, StopIteration):
pass
- for host in hosts:
+ for host in [h for h in hosts if h.is_master() or h.is_node()]:
if host.connect_to in callback_facts.keys() and is_installed_host(host, callback_facts):
installed_hosts.append(host)
return installed_hosts
@@ -860,21 +875,6 @@ def upgrade(ctx, latest_minor, next_major):
oo_cfg = ctx.obj['oo_cfg']
verbose = ctx.obj['verbose']
- # major/minor fields are optional, as we don't always support minor/major
- # upgrade for what you're currently running.
- upgrade_mappings = {
- '3.1':{
- 'major_playbook':'v3_2/upgrade.yml',
- 'major_version' :'3.2',
- },
- '3.2':{
- 'minor_playbook':'v3_2/upgrade.yml',
-# Uncomment these when we're ready to support 3.3.
-# 'major_version' :'3.3',
-# 'major_playbook':'v3_1_to_v3_2/upgrade.yml',
- },
- }
-
if len(oo_cfg.deployment.hosts) == 0:
click.echo("No hosts defined in: %s" % oo_cfg.config_path)
sys.exit(1)
@@ -885,7 +885,7 @@ def upgrade(ctx, latest_minor, next_major):
sys.exit(0)
old_version = oo_cfg.settings['variant_version']
- mapping = upgrade_mappings.get(old_version)
+ mapping = UPGRADE_MAPPINGS.get(old_version)
message = """
This tool will help you upgrade your existing OpenShift installation.
@@ -940,8 +940,7 @@ def upgrade(ctx, latest_minor, next_major):
if not ctx.obj['unattended']:
# Prompt interactively to confirm:
- proceed = click.confirm("\nDo you wish to proceed?")
- if not proceed:
+ if not click.confirm("\nDo you wish to proceed?"):
click.echo("Upgrade cancelled.")
sys.exit(0)