def avail_locations(conn=None, call=None):
    '''
    List available locations/datacenters for 1&1
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_locations function must be called with '
            '-f or --function, or with the --list-locations option'
        )

    datacenters = []

    if not conn:
        conn = get_conn()

    for datacenter in conn.list_datacenters():
        datacenters.append({datacenter['country_code']: datacenter})

    return {'Locations': datacenters}
def avail_locations ( conn = None , call = None ) : if call == 'action' : raise SaltCloudSystemExit ( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) datacenters = [ ] if not conn : conn = get_conn ( ) for datacenter in conn . list_datacenters ( ) : datacenters . append ( { datacenter [ 'country_code' ] : datacenter } ) return { 'Locations' : datacenters }
List available locations/datacenters for 1&1