def list_datacenters(conn=None, call=None):
 if (call != 'function'):
  raise SaltCloudSystemExit('The list_datacenters function must be called with -f or --function.')
 datacenters = []
 if (not conn):
  conn = get_conn()
 for item in conn.list_datacenters()['items']:
  datacenter = {'id': item['id']}
  datacenter.update(item['properties'])
  datacenters.append({item['properties']['name']: datacenter})
 return {'Datacenters': datacenters}

def list_datacenters ( conn = None , call = None ) : if ( call != 'function' ) : raise SaltCloudSystemExit ( 'The list_datacenters function must be called with -f or --function.' ) datacenters = [ ] if ( not conn ) : conn = get_conn ( ) for item in conn . list_datacenters ( ) [ 'items' ] : datacenter = { 'id' : item [ 'id' ] } datacenter . update ( item [ 'properties' ] ) datacenters . append ( { item [ 'properties' ] [ 'name' ] : datacenter } ) return { 'Datacenters' : datacenters }
returns a list of datacenters for the the specified host .