Browse Source

Merge pull request #2290 from smunilla/BZ1357627

a-o-i: Fix broken upgrades
Scott Dodson 8 years ago
parent
commit
34c9ba2d29
2 changed files with 5 additions and 6 deletions
  1. 3 4
      utils/src/ooinstall/cli_installer.py
  2. 2 2
      utils/src/ooinstall/openshift_ansible.py

+ 3 - 4
utils/src/ooinstall/cli_installer.py

@@ -1,5 +1,3 @@
-# TODO: Temporarily disabled due to importing old code into openshift-ansible
-# repo. We will work on these over time.
 # pylint: disable=bad-continuation,missing-docstring,no-self-use,invalid-name,no-value-for-parameter,too-many-lines
 
 import os
@@ -884,7 +882,6 @@ def uninstall(ctx):
 #pylint: disable=bad-builtin,too-many-statements
 def upgrade(ctx, latest_minor, next_major):
     oo_cfg = ctx.obj['oo_cfg']
-    verbose = ctx.obj['verbose']
 
     if len(oo_cfg.deployment.hosts) == 0:
         click.echo("No hosts defined in: %s" % oo_cfg.config_path)
@@ -955,7 +952,9 @@ def upgrade(ctx, latest_minor, next_major):
             click.echo("Upgrade cancelled.")
             sys.exit(0)
 
-    retcode = openshift_ansible.run_upgrade_playbook(playbook, verbose)
+    retcode = openshift_ansible.run_upgrade_playbook(oo_cfg.deployment.hosts,
+                                                     playbook,
+                                                     ctx.obj['verbose'])
     if retcode > 0:
         click.echo("Errors encountered during upgrade, please check %s." %
             oo_cfg.settings['ansible_log_path'])

+ 2 - 2
utils/src/ooinstall/openshift_ansible.py

@@ -290,12 +290,12 @@ def run_uninstall_playbook(hosts, verbose=False):
     return run_ansible(playbook, inventory_file, facts_env, verbose)
 
 
-def run_upgrade_playbook(playbook, verbose=False):
+def run_upgrade_playbook(hosts, playbook, verbose=False):
     playbook = os.path.join(CFG.settings['ansible_playbook_directory'],
             'playbooks/byo/openshift-cluster/upgrades/{}'.format(playbook))
 
     # TODO: Upgrade inventory for upgrade?
-    inventory_file = generate_inventory(CFG.hosts)
+    inventory_file = generate_inventory(hosts)
     facts_env = os.environ.copy()
     if 'ansible_log_path' in CFG.settings:
         facts_env['ANSIBLE_LOG_PATH'] = CFG.settings['ansible_log_path']