Пример #1
0
 def wait_for_cluster_validation(self,
                                 validation_section,
                                 validation_id,
                                 statuses,
                                 timeout=consts.VALIDATION_TIMEOUT,
                                 interval=2):
     logging.info("Wait until cluster %s validation %s is in status %s",
                  self.id, validation_id, statuses)
     try:
         waiting.wait(
             lambda: self.is_cluster_validation_in_status(
                 validation_section=validation_section,
                 validation_id=validation_id,
                 statuses=statuses),
             timeout_seconds=timeout,
             sleep_seconds=interval,
             waiting_for="Cluster validation to be in status %s" % statuses,
         )
     except BaseException:
         logging.error(
             "Cluster validation status is: %s",
             utils.get_cluster_validation_value(
                 self.api_client.cluster_get(self.id), validation_section,
                 validation_id))
         raise
Пример #2
0
 def assert_cluster_validation(cluster_info, validation_section,
                               validation_id, expected_status):
     found_status = infra_utils.get_cluster_validation_value(
         cluster_info, validation_section, validation_id)
     assert found_status == expected_status, (
         "Found validation status " + found_status + " rather than " +
         expected_status + " for validation " + validation_id)
Пример #3
0
 def is_cluster_validation_in_status(self, validation_section,
                                     validation_id, statuses):
     log.info("Is cluster %s validation %s in status %s", self.id,
              validation_id, statuses)
     try:
         return (utils.get_cluster_validation_value(
             self.api_client.cluster_get(self.id), validation_section,
             validation_id) in statuses)
     except BaseException:
         log.exception("Failed to get cluster %s validation info", self.id)