Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow hostname lookup for flexible --serverInstance values #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Allow hostname lookup for flexible --serverInstance values #3

wants to merge 1 commit into from

Conversation

stephen-soltesz
Copy link

@stephen-soltesz stephen-soltesz commented Aug 7, 2020

When running the replay_client.py and specifying a serverInstance that is not in the self.ips map, the client aborts.

This change adds a try/except block around the socket.gethostbyname to first try self.ips and then uses the machineName directly.

$ python src/replay_client.py --pcap_folder=./replayTraces/Vimeo_12122018/ --serverInstance=wehe-mlab1-lga0t.mlab-sandbox.measurement-lab.org
 [1]Reading configs file and args)
Traceback (most recent call last):
  File "src/replay_client.py", line 1082, in <module>
    main()
  File "src/replay_client.py", line 1079, in main
    run()
  File "src/replay_client.py", line 862, in run
    initialSetup()
  File "src/replay_client.py", line 1049, in initialSetup
    configs.set('serverInstanceIP', Instance().getIP(configs.get('serverInstance')))
  File "/Users/soltesz/src/github.com/m-lab/wehe_desktop/src/python_lib.py", line 565, in getIP
    ip = socket.gethostbyname( self.ips[machineName] )
KeyError: 'wehe-mlab1-lga0t.mlab-sandbox.measurement-lab.org'

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant