Browse Source

GCE deployment fails due to invalid lookup

Data is only available under ['instance'] and split was in the wrong
order.  This deploys against GCE for me.
Clayton Coleman 8 years ago
parent
commit
42dfc8eefd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      roles/openshift_facts/library/openshift_facts.py

+ 1 - 1
roles/openshift_facts/library/openshift_facts.py

@@ -1019,7 +1019,7 @@ def set_nodename(facts):
         if 'cloudprovider' in facts and facts['cloudprovider']['kind'] == 'openstack':
             facts['node']['nodename'] = facts['provider']['metadata']['hostname'].replace('.novalocal', '')
         elif 'cloudprovider' in facts and facts['cloudprovider']['kind'] == 'gce':
-            facts['node']['nodename'] = '.'.split(facts['provider']['metadata']['hostname'])[0]
+            facts['node']['nodename'] = facts['provider']['metadata']['instance']['hostname'].split('.')[0]
         else:
             facts['node']['nodename'] = facts['common']['hostname'].lower()
     return facts