From b0955d50b2beaa2b1e3937185f6d5e5337e1e87f Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Tue, 10 Nov 2015 09:10:58 -0400 Subject: 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) --- roles/openshift_facts/library/openshift_facts.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'roles/openshift_facts/library') 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'): -- cgit v1.2.3