def read_node_to_hostname_mapping(config_file):
    """ Returns two maps: <ns_id, hostname> and <lns_id, hostname> by parsing a node config file"""

    ns_ids = {}
    lns_ids = {}

    for line in open(config_file):
        tokens = line.split()
        if tokens[1].lower() == 'yes' or tokens[1].lower() == 'true':
            ns_ids[tokens[0]] = tokens[2]
        else:
            lns_ids[tokens[0]] = tokens[2]
    return ns_ids, lns_ids