#NEWLINE# @ classmethod #NEWLINE# def sleep_until_port_is_open( cls , host , port , is_verbose ) : #NEWLINE# #INDENT# 'Queries the given host to see if the named port is open, and if not,\n    waits until it is.\n\n    Args:\n      host: A str representing the host whose port we should be querying.\n      port: An int representing the port that should eventually be open.\n      verbose: A bool that indicates if we should print failure messages to\n        stdout (e.g., connection refused messages that can occur when we wait\n        for services to come up).\n    ' #NEWLINE# sleep_time = 1 #NEWLINE# while ( not cls . is_port_open ( host , port , is_verbose ) ) : #NEWLINE# #INDENT# AppScaleLogger . verbose ( 'Waiting {2} second(s) for {0}:{1} to open' . format ( host , port , sleep_time ) , is_verbose ) #NEWLINE# time . sleep ( cls ) #NEWLINE# sleep_time = min ( ( sleep_time * 2 ) , 20 )