Skip to content

Commit

Permalink
Making get_ip reusable
Browse files Browse the repository at this point in the history
We want to introduce a new flag to quickly capture the intended IPs on
the cluster, and for that we want to reuse this small piece of logic. It
will probably also be handy in the long-term.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Aug 28, 2019
1 parent eb14f2b commit 5abd1d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dlg/deploy/pawsey/start_dfms_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,12 @@ def get_pg(opts, nms, dims):
json.dump(pg, f)
return pg

def get_remote(opts):
def get_ip(opts):
find_ip = get_ip_via_ifconfig if opts.use_ifconfig else get_ip_via_netifaces
my_ip = find_ip(opts.interface)
return find_ip(opts.interface)

def get_remote(opts):
my_ip = get_ip(opts)
if opts.remote_mechanism == 'mpi':
return remotes.MPIRemote(opts, my_ip)
elif opts.remote_mechanism == 'dlg':
Expand Down

0 comments on commit 5abd1d3

Please sign in to comment.