def METHOD_NAME(localhost_using_legacy_db):
    from nav.db import getConnection
    conn = getConnection('default')
    cursor = conn.cursor()
    sql = """
        INSERT INTO interface
        (netboxid)
        VALUES
        (%s)
        RETURNING interfaceid;
        """
    cursor.execute(sql, (localhost_using_legacy_db,))
    interfaceid = cursor.fetchone()[0]
    conn.commit()
    yield interfaceid
    print("teardown interface using legacy connection")
    cursor.execute("DELETE FROM interface WHERE interfaceid=%s", (interfaceid,))
    conn.commit()