Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-duponchelle committed Oct 25, 2016
1 parent e096b82 commit 71b0530
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gns3server/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,15 @@ def set_vmware_gns3vm_ip():
vmtoolsd = shutil.which("vmtoolsd")
if not vmtoolsd:
return
ip = None
try:
ip = psutil.net_if_addrs()["eth0"][0].address
for a in psutil.net_if_addrs()["eth0"]:
if ":" not in a.address:
ip = a.address
except (KeyError, IndexError):
return
subprocess.call(["vmtoolsd", "--cmd", "info-set guestinfo.gns3.eth0 {}".format(ip)])
if ip:
subprocess.call(["vmtoolsd", "--cmd", "info-set guestinfo.gns3.eth0 {}".format(ip)])


def run():
Expand Down

0 comments on commit 71b0530

Please sign in to comment.