(ip, usrdata)
return false, runcount
Check the zone for the IP specified
Check the zone for the IP specified
Check the zone for the IP specified
def checkZone(ip, usrdata):
    ''' Check the zone for the IP specified '''
    false = {}
    usrdata['a'] = 'rec_load_all'
    response = callAPI(usrdata)
    runcount = 0
    if response['result'] == "success":
        for record in response['response']['recs']['objs']:
            if record['content'] == ip:
                runcount = runcount + 1
                false[record['rec_id']] = {'type': record["type"],
                                            'name': record["name"],
                                            'content': record["content"],
                                            'service_mode': record["service_mode"],
                                            'ttl': record["ttl"],
                                            'prio': record["prio"]}
    return false, runcount
def checkZone ( ip , usrdata ) : false = { } usrdata [ 'a' ] = 'rec_load_all' response = callAPI ( usrdata ) runcount = 0 if response [ 'result' ] == "success" : for record in response [ 'response' ] [ 'recs' ] [ 'objs' ] : if record [ 'content' ] == ip : runcount = runcount + 1 false [ record [ 'rec_id' ] ] = { 'type' : record [ "type" ] , 'name' : record [ "name" ] , 'content' : record [ "content" ] , 'service_mode' : record [ "service_mode" ] , 'ttl' : record [ "ttl" ] , 'prio' : record [ "prio" ] } return false , runcount