From 9b1dd97dbf5f205edf4a0e1b24d24a3f9d8a78e6 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Mon, 7 Nov 2016 16:25:56 -0500 Subject: Revert "Check that OpenStack hostnames are resolvable" This reverts commit 3cc2d6b019fa8a05ba480a7425cd654aa051355f. --- roles/openshift_facts/library/openshift_facts.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'roles/openshift_facts') diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 95325610d..36a2d1f4f 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -363,15 +363,12 @@ def normalize_openstack_facts(metadata, facts): facts['network']['ip'] = local_ipv4 facts['network']['public_ip'] = metadata['ec2_compat']['public-ipv4'] - for f_var, h_var, ip_var in [('hostname', 'hostname', 'local-ipv4'), - ('public_hostname', 'public-hostname', 'public-ipv4')]: - try: - if socket.gethostbyname(metadata['ec2_compat'][h_var]) == metadata['ec2_compat'][ip_var]: - facts['network'][f_var] = metadata['ec2_compat'][h_var] - else: - facts['network'][f_var] = metadata['ec2_compat'][ip_var] - except socket.gaierror: - facts['network'][f_var] = metadata['ec2_compat'][ip_var] + # TODO: verify local hostname makes sense and is resolvable + facts['network']['hostname'] = metadata['hostname'] + + # TODO: verify that public hostname makes sense and is resolvable + pub_h = metadata['ec2_compat']['public-hostname'] + facts['network']['public_hostname'] = pub_h return facts -- cgit v1.2.3 From 90345971adfb4385c8336e5e3a6ae6487a809bac Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Mon, 7 Nov 2016 16:34:05 -0500 Subject: Revert "Fix OpenStack cloud provider" This reverts commit 1f2276fff1e41c1d9440ee8b589042ee249b95d7. --- roles/openshift_facts/library/openshift_facts.py | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'roles/openshift_facts') diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 36a2d1f4f..4e68d9710 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -148,7 +148,6 @@ def hostname_valid(hostname): if (not hostname or hostname.startswith('localhost') or hostname.endswith('localdomain') or - hostname.endswith('novalocal') or len(hostname.split('.')) < 2): return False @@ -918,14 +917,6 @@ def set_sdn_facts_if_unset(facts, system_facts): return facts -def set_nodename(facts): - if 'node' in facts and 'common' in facts: - if 'cloudprovider' in facts and facts['cloudprovider']['kind'] == 'openstack': - facts['node']['nodename'] = facts['provider']['metadata']['hostname'].replace('.novalocal', '') - else: - facts['node']['nodename'] = facts['common']['hostname'].lower() - return facts - def migrate_oauth_template_facts(facts): """ Migrate an old oauth template fact to a newer format if it's present. @@ -1785,7 +1776,6 @@ class OpenShiftFacts(object): facts = set_proxy_facts(facts) if not safe_get_bool(facts['common']['is_containerized']): facts = set_installed_variant_rpm_facts(facts) - facts = set_nodename(facts) return dict(openshift=facts) def get_defaults(self, roles, deployment_type, deployment_subtype): -- cgit v1.2.3 From 0cd7191cd788d2e6b0ec8d3c5f52562433ed8a13 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Mon, 7 Nov 2016 16:38:42 -0500 Subject: Revert "Fix the nodeName of the OpenShift nodes on OpenStack" This reverts commit aaaf82ba6032d0b1e9c36a39a7eda25b8c5f4b84. --- roles/openshift_facts/library/openshift_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/openshift_facts') diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 4e68d9710..645dfdd95 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -1293,7 +1293,7 @@ def apply_provider_facts(facts, provider_facts): facts['common'][h_var] = choose_hostname( [provider_facts['network'].get(h_var)], - facts['common'][h_var] + facts['common'][ip_var] ) facts['provider'] = provider_facts -- cgit v1.2.3