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 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
set nodename .