while(not ready and time.time() < timeout):
logging.info("Tunnel endpoints configured. Waiting for tunnel...")
ready = benchmark_spec.vpn_gateways[self.GWPair[0]].IsTunnelReady(self.tunnel_config.endpoints[self.GWPair[0]]["tunnel_id"]) and benchmark_spec.vpn_gateways[self.GWPair[1]].IsTunnelReady(self.tunnel_config.endpoints[self.GWPair[1]]["tunnel_id"])
time.sleep(5)
return ready
After Change
logging.info("Tunnel endpoints configured. Waiting for tunnel...")
ready = benchmark_spec.vpn_gateways[self.GWPair[0]].IsTunnelReady(self.tunnel_config.endpoints[self.GWPair[0]]["tunnel_id"]) and benchmark_spec.vpn_gateways[self.GWPair[1]].IsTunnelReady(self.tunnel_config.endpoints[self.GWPair[1]]["tunnel_id"])
if not ready:
raise errors.Resource.RetryableCreationError()
return ready