def normalize_provider_facts(provider, metadata):
 if ((provider is None) or (metadata is None)):
  return {}
 facts = dict(name=provider, metadata=metadata, network=dict(interfaces=[], ipv6_enabled=False))
 if (provider == 'gce'):
  facts = normalize_gce_facts(metadata, facts)
 elif (provider == 'aws'):
  facts = normalize_aws_facts(metadata, facts)
 elif (provider == 'openstack'):
  facts = normalize_openstack_facts(metadata, facts)
 return facts

def normalize_provider_facts ( provider , metadata ) : if ( ( provider is None ) or ( metadata is None ) ) : return { } facts = dict ( name = provider , metadata = metadata , network = dict ( interfaces = [ ] , ipv6_enabled = False ) ) if ( provider == 'gce' ) : facts = normalize_gce_facts ( metadata , facts ) elif ( provider == 'aws' ) : facts = normalize_aws_facts ( metadata , facts ) elif ( provider == 'openstack' ) : facts = normalize_openstack_facts ( metadata , facts ) return facts
normalize provider facts args: provider : host provider metadata : provider metadata returns: dict: the normalized provider facts .