Skip to content

Commit

Permalink
make get_ip method mac friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
mrniket committed Nov 3, 2017
1 parent 9750c1c commit 40538be
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions minikube.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import stat
import tarfile
import yaml
import platform
from run import run_command
from urllib import urlretrieve
from urllib2 import urlopen
Expand Down Expand Up @@ -83,6 +84,10 @@ def download_minikube():

def get_ip():
# http://stackoverflow.com/a/28950776/671626
os_name = platform.system()
if os_name == "Darwin":
return socket.gethostbyname(socket.gethostname())

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
# doesn't even have to be reachable
Expand Down

0 comments on commit 40538be

Please sign in to comment.