datastax / cstar_perf

Apache Cassandra performance testing platform
Apache License 2.0
72 stars 34 forks source link

CSTAR-624: Fix IP retrieval in benchmark.get_localhost #233

Closed csplinter closed 8 years ago

csplinter commented 8 years ago

We are using the following to get the ip address in benchmark.get_localhost()

ip = socket.gethostname().split(".")[0]

This causes issues on openstack

>>> ip = socket.gethostname().split(".")[0]
>>> print ip
ip-10-200-180-168
>>> print socket.gethostname()
ip-10-200-180-168.datastax.lan

We should instead use

>>> print socket.gethostbyname(socket.gethostname())
10.200.180.168

I tested on openstack and docker setups

nastra commented 8 years ago

+1