<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def atlasdb_add_zonefile_info( name, zonefile_hash, txid, present, tried_storage, block_height, con=None, path=None ):
 """ Add a zonefile to the database. Mark it as present or absent. Keep our in-RAM inventory vector up-to-date """

    global ZONEFILE_INV, NUM_ZONEFILES, ZONEFILE_INV_LOCK

    with AtlasDBOpen( con=con, path=path ) as dbcon:
        with ZONEFILE_INV_LOCK:
            # need to lock here since someone could call atlasdb_cache_zonefile_info
            if present:
                present = 1
            else:
                present = 0

            if tried_storage:
                tried_storage = 1
            else:
                tried_storage = 0

            sql = "UPDATE zonefiles SET name = ?, zonefile_hash = ?, txid = ?, present = ?, tried_storage = ?, block_height = ? WHERE txid = ?;"
            args = (name, zonefile_hash, txid, present, tried_storage, block_height, txid )

            cur = dbcon.cursor()
            update_res = atlasdb_query_execute( cur, sql, args )
            dbcon.commit()

            if update_res.rowcount == 0:
                sql = "INSERT OR IGNORE INTO zonefiles (name, zonefile_hash, txid, present, tried_storage, block_height) VALUES (?,?,?,?,?,?);"
                args = (name, zonefile_hash, txid, present, tried_storage, block_height)
            
                cur = dbcon.cursor()
                atlasdb_query_execute( cur, sql, args )
                dbcon.commit()

            # keep in-RAM zonefile inv coherent
            zfbits = atlasdb_get_zonefile_bits( zonefile_hash, con=dbcon, path=path )

            inv_vec = None
            if ZONEFILE_INV is None:
                inv_vec = ""
            else:
                inv_vec = ZONEFILE_INV[:]

            ZONEFILE_INV = atlas_inventory_flip_zonefile_bits( inv_vec, zfbits, present )
            log.debug('Set {} ({}) to {}'.format(zonefile_hash, ','.join(str(i) for i in zfbits), present))

            # keep in-RAM zonefile count coherent
            NUM_ZONEFILES = atlasdb_zonefile_inv_length( con=dbcon, path=path )

    return True