import csv


def read_path2port_map(filename):
    """
    Reads csv file containing two columns: column1 is path name,
     column2 is port number

    :param filename:
    :return: dictionary with port as key and path as value
    """
    res = {}
    with open(filename, 'r') as csvfile:
        reader = csv.reader(csvfile)
        for row in reader:
            res[row[1]] = row[0]
    return res