make host connectable when ip is empty

turn '' into 'localhost', so that it is a valid URL for connection
This commit is contained in:
Min RK
2015-03-04 11:52:49 -08:00
parent 09b27ca44d
commit c991438c3d
2 changed files with 7 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ class Server(Base):
def host(self):
return "{proto}://{ip}:{port}".format(
proto=self.proto,
ip=self.ip or '*',
ip=self.ip or 'localhost',
port=self.port,
)
@@ -92,7 +92,7 @@ class Server(Base):
def wait_up(self, timeout=10, http=False):
"""Wait for this server to come up"""
if http:
yield wait_for_http_server(self.url.replace('//*', '//localhost'), timeout=timeout)
yield wait_for_http_server(self.url, timeout=timeout)
else:
yield wait_for_server(self.ip or 'localhost', self.port, timeout=timeout)