Unverified Commit 8349002d authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

Cleanup lookup_all_hosts routine

Lookup of the local daemon is not different from a remote one thus we
can use the same code.
parent 33edf5ac
Loading
Loading
Loading
Loading
+14 −22
Original line number Diff line number Diff line
@@ -200,13 +200,6 @@ bool lookup_all_hosts() {
    hg_addr_t remote_addr = HG_ADDR_NULL;
    std::string remote_uri;
    for (auto& host : hosts) {
        if (host == CTX->fs_conf()->host_id) {
            remote_addr = get_local_addr();
            if (remote_addr == HG_ADDR_NULL) {
                CTX->log()->error("{}() Failed to lookup local address", __func__);
                return false;
            }
        } else {
        auto hostname = CTX->fs_conf()->hosts.at(host) + HOSTNAME_SUFFIX;
        // get the ip address from /etc/hosts which is mapped to the sys_hostfile map
        if (CTX->fs_conf()->sys_hostfile.count(hostname) == 1) {
@@ -224,7 +217,6 @@ bool lookup_all_hosts() {
        }
        CTX->log()->trace("generated remote_addr {} for hostname {} with rpc_port {}",
                remote_uri, hostname, CTX->fs_conf()->rpc_port);
        }
        rpc_addresses->insert(make_pair(host, remote_addr));
    }
    return true;