diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2015-11-10 09:10:58 -0400 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2015-11-10 10:02:41 -0400 |
commit | b0955d50b2beaa2b1e3937185f6d5e5337e1e87f (patch) | |
tree | d2d4d4e96b4440e408a4155d2247e2366d7272bd | |
parent | c2f3f81d926aacbd1fe973c36931dc5ad2ebe7c5 (diff) | |
download | openshift-b0955d50b2beaa2b1e3937185f6d5e5337e1e87f.tar.gz openshift-b0955d50b2beaa2b1e3937185f6d5e5337e1e87f.tar.bz2 openshift-b0955d50b2beaa2b1e3937185f6d5e5337e1e87f.tar.xz openshift-b0955d50b2beaa2b1e3937185f6d5e5337e1e87f.zip |
Fix missing etcd_data_dir bug.
A late change to original PR was not properly tested, there is a problem in the
facts when upgrading where the deployment type is openshift-enterprise, and the
system facts start reporting data_dir and config_base as referencing origin
directories, which are not yet symlinked to their previous openshift variants.
To correct we watch for a scenario where we evaluate these to origin
directories, which don't exist, but the openshift ones do. (to allow for
installation to still point at the origin variety)
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 932bfd441..c108cd422 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -604,11 +604,17 @@ def set_deployment_facts_if_unset(facts): config_base = '/etc/origin' if deployment_type in ['enterprise', 'online']: config_base = '/etc/openshift' + # Handle upgrade scenarios when symlinks don't yet exist: + if not os.path.exists(config_base) and os.path.exists('/etc/openshift'): + config_base = '/etc/openshift' facts['common']['config_base'] = config_base if 'data_dir' not in facts['common']: data_dir = '/var/lib/origin' if deployment_type in ['enterprise', 'online']: data_dir = '/var/lib/openshift' + # Handle upgrade scenarios when symlinks don't yet exist: + if not os.path.exists(data_dir) and os.path.exists('/var/lib/openshift'): + data_dir = '/var/lib/openshift' facts['common']['data_dir'] = data_dir for role in ('master', 'node'): |