def get_location_id(manager, location):
    """Returns location id

    :param manager: The storage manager which calls this function.
    :param location: Datacenter short name
    :return: Returns location id
    """
    loc_svc = manager.client['Location_Datacenter']
    datacenters = loc_svc.getDatacenters(mask='mask[longName,id,name]')
    for datacenter in datacenters:
        if datacenter['name'] == location:
            location = datacenter['id']
            return location
    raise ValueError('Invalid datacenter name specified.')
def get_location_id ( manager , location ) : loc_svc = manager . client [ 'Location_Datacenter' ] datacenters = loc_svc . getDatacenters ( mask = 'mask[longName,id,name]' ) for datacenter in datacenters : if datacenter [ 'name' ] == location : location = datacenter [ 'id' ] return location raise ValueError ( 'Invalid datacenter name specified.' )
Returns location id

    :param manager: The storage manager which calls this function.
    :param location: Datacenter short name
    :return: Returns location id