update status db

def update_status(dbfile,status_file,nas_addr):
    ''' update status db
    '''
    try:
        total = 0
        params = []
        for sid, su in  parse_status_file(status_file, nas_addr).items():
            if 'session_id' in su and 'inbytes' in su and 'outbytes' in su:
                params.append((su['inbytes'],su['outbytes'],su['session_id']))
                total += 1
        statusdb.batch_update_client(dbfile,params)
        log.msg('update_status total = %s' % total)
    except Exception, e:
        log.err('batch update status error')
        log.err(e)