summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client/trex_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/client/trex_client.py')
-rwxr-xr-xscripts/automation/trex_control_plane/client/trex_client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_client.py b/scripts/automation/trex_control_plane/client/trex_client.py
index 1d94dc06..9e3944d4 100755
--- a/scripts/automation/trex_control_plane/client/trex_client.py
+++ b/scripts/automation/trex_control_plane/client/trex_client.py
@@ -61,14 +61,17 @@ class CTRexClient(object):
socket errors, in case server could not be reached.
"""
- self.trex_host = trex_host
+ try:
+ self.trex_host = socket.gethostbyname(trex_host)
+ except: # give it another try
+ self.trex_host = socket.gethostbyname(trex_host)
self.trex_daemon_port = trex_daemon_port
self.trex_zmq_port = trex_zmq_port
self.seq = None
self.verbose = verbose
self.result_obj = CTRexResult(max_history_size)
self.decoder = JSONDecoder()
- self.trex_server_path = "http://{hostname}:{port}/".format( hostname = trex_host, port = trex_daemon_port )
+ self.trex_server_path = "http://{hostname}:{port}/".format( hostname = self.trex_host, port = trex_daemon_port )
self.__verbose_print("Connecting to TRex @ {trex_path} ...".format( trex_path = self.trex_server_path ) )
self.history = jsonrpclib.history.History()
self.server = jsonrpclib.Server(self.trex_server_path, history = self.history)