##// END OF EJS Templates
parallel.apps.ipcontrollerapp: Use utils.localinterfaces...
W. Trevor King -
Show More
@@ -25,7 +25,6 b' from __future__ import with_statement'
25 25
26 26 import json
27 27 import os
28 import socket
29 28 import stat
30 29 import sys
31 30
@@ -45,6 +44,7 b' from IPython.parallel.apps.baseapp import ('
45 44 catch_config_error,
46 45 )
47 46 from IPython.utils.importstring import import_item
47 from IPython.utils.localinterfaces import LOCALHOST, PUBLIC_IPS
48 48 from IPython.utils.traitlets import Instance, Unicode, Bool, List, Dict, TraitError
49 49
50 50 from IPython.zmq.session import (
@@ -220,13 +220,13 b' class IPControllerApp(BaseParallelApplication):'
220 220 location = cdict['location']
221 221
222 222 if not location:
223 try:
224 location = socket.gethostbyname_ex(socket.gethostname())[2][-1]
225 except (socket.gaierror, IndexError):
226 self.log.warn("Could not identify this machine's IP, assuming 127.0.0.1."
223 if PUBLIC_IPS:
224 location = PUBLIC_IPS[-1]
225 else:
226 self.log.warn("Could not identify this machine's IP, assuming %s."
227 227 " You may need to specify '--location=<external_ip_address>' to help"
228 " IPython decide when to connect via loopback.")
229 location = '127.0.0.1'
228 " IPython decide when to connect via loopback." % LOCALHOST)
229 location = LOCALHOST
230 230 cdict['location'] = location
231 231 fname = os.path.join(self.profile_dir.security_dir, fname)
232 232 self.log.info("writing connection info to %s", fname)
General Comments 0
You need to be logged in to leave comments. Login now