def execute(self, compute_id, amphora_id, availability_zone): """Wait for the compute driver to mark the amphora active :param compute_id: virtual machine UUID :param amphora_id: id of the amphora object :param availability_zone: availability zone metadata dictionary :raises: Generic exception if the amphora is not active :returns: An amphora object """ if availability_zone: amp_network = availability_zone.get(constants.MANAGEMENT_NETWORK) else: amp_network = None for i in range(CONF.controller_worker.amp_active_retries): amp, fault = self.compute.get_amphora(compute_id, amp_network) if amp.status == constants.ACTIVE: if CONF.haproxy_amphora.build_rate_limit != -1: self.rate_limit.remove_from_build_req_queue(amphora_id) return amp.to_dict() if amp.status == constants.ERROR: raise exceptions.ComputeBuildException(fault=fault) time.sleep(CONF.controller_worker.amp_active_wait_sec) raise exceptions.ComputeWaitTimeoutException(id=compute_id)
def execute(self, compute_id): """Wait for the compute driver to mark the amphora active :raises: Generic exception if the amphora is not active :returns: An amphora object """ time.sleep(CONF.controller_worker.amp_active_wait_sec) amp = self.compute.get_amphora(compute_id) if amp.status == constants.ACTIVE: return amp raise exceptions.ComputeWaitTimeoutException()
def execute(self, compute_id, amphora_id): """Wait for the compute driver to mark the amphora active""" for i in range(CONF.a10_controller_worker.amp_active_retries): amp, fault = self.compute.get_amphora(compute_id) if amp.status == constants.ACTIVE: if CONF.a10_controller_worker.build_rate_limit != -1: self.rate_limit.remove_from_build_req_queue(amphora_id) return amp elif amp.status == constants.ERROR: raise exceptions.ComputeBuildException(fault=fault) time.sleep(CONF.a10_controller_worker.amp_active_wait_sec) raise exceptions.ComputeWaitTimeoutException(id=compute_id)
def execute(self, compute_id, amphora_id): """Wait for the compute driver to mark the amphora active :raises: Generic exception if the amphora is not active :returns: An amphora object """ for i in range(CONF.controller_worker.amp_active_retries): amp = self.compute.get_amphora(compute_id) if amp.status == constants.ACTIVE: if CONF.haproxy_amphora.build_rate_limit != -1: self.rate_limit.remove_from_build_req_queue(amphora_id) return amp elif amp.status == constants.ERROR: raise exceptions.ComputeBuildException() time.sleep(CONF.controller_worker.amp_active_wait_sec) raise exceptions.ComputeWaitTimeoutException()