def _check_port_presence(): is_present = bool(self._client.find_all(id=port['id'])) return waiter.expect_that(is_present, equal_to(must_present))
def predicate(): volumes = self._client.get_server_volumes(server.id) matcher = has_item(has_properties(id=volume.id)) if not is_attached: matcher = is_not(matcher) return waiter.expect_that(volumes, matcher)
def _check_volume_status(): volume.get() return waiter.expect_that(volume.status, is_not(any_of(*transit_matchers)))
def _check_volume_size(): volume.get() return waiter.expect_that(volume.size, equal_to(size))
def _check_service_states(): current_services = self.get_services() current_services_data = self._get_service_data(current_services) return waiter.expect_that(current_services_data, equal_to(expected_service_data))
def _check_status(): lb = self._client.lbaas_loadbalancers.get(loadbalancer['id']) waiter.expect_that(lb['provisioning_status'], is_not(starts_with('PENDING_'))) return lb
def _check_ssh_connection_establishment(): return waiter.expect_that(server_ssh.check(), equal_to(must_work), err_msg)
def _get_prop(): stack.get() return waiter.expect_that( getattr(stack, property_name).lower(), is_not(is_in(transit_values)))
def _check_volume_host(): volume.get() volume_host = getattr(volume, config.VOLUME_HOST_ATTR) return waiter.expect_that(volume_host.lower(), equal_to(host.lower()))
def _check_execution_status(): execution = self.get_execution(execution_id) actual_status = execution['data']['state'].lower() assert_that(actual_status, is_not(failure_status)) return waiter.expect_that(actual_status, equal_to(status))
def _check_migration_status(): volume.get() return waiter.expect_that((volume.migration_status or '').lower(), equal_to(status.lower()))
def _check_volume_attachments(): volume.get() attached_ids = self.get_attached_server_ids(volume, check=False) return waiter.expect_that(set(attached_ids), equal_to(set(server_ids)))
def _is_ec2_file_downloaded(): return waiter.expect_that( os.stat(self._ec2_path).st_size, greater_than(0))
def _is_rc_file_downloaded(): waiter.expect_that(os.path.isfile(self._rc_path), equal_to(True)) return waiter.expect_that( os.stat(self._rc_path).st_size, greater_than(0))
def _check_network_rescheduled(): dhcp_agents = self._client.get_dhcp_agents_for_network( network['id']) dhcp_agents_ids = [agent['id'] for agent in dhcp_agents] return waiter.expect_that(old_dhcp_agent['id'], is_not(is_in(dhcp_agents_ids)))
def _check_backup_status(): backup.get() return waiter.expect_that(backup.status, is_not(any_of(*transit_matchers)))
def _check_network_is_on_agent(): dhcp_agents = self._client.get_dhcp_agents_for_network( network['id']) return waiter.expect_that(dhcp_agent, is_in(dhcp_agents))
def _check_nets_count_for_agent(): networks = self.get_networks_for_dhcp_agent(agent, check=False) return waiter.expect_that(networks, has_length(expected_count))
def _check_router_rescheduled(): l3_agents = self._client.get_l3_agents_for_router(router['id']) return waiter.expect_that(old_l3_agent, is_not(is_in(l3_agents)))
def _wait_cell_status(): matchers = [equal_to_ignoring_case(status) for status in self.transit_statuses] return waiter.expect_that(cell.value, is_not( any_of(*matchers)))
def _check_router_rescheduled(): l3_agents = self.get_l3_agents_for_router( router, filter_attrs=config.HA_STATE_ACTIVE_ATTRS, check=False) waiter.expect_that(l3_agents, is_not(empty())) waiter.expect_that(old_l3_agent, is_not(is_in(l3_agents))) return l3_agents
def _check_subnet_presence(): is_present = bool( self._client.find_all(id=subnet['id'], current_project_only=False)) return waiter.expect_that(is_present, equal_to(must_present))
def _check_router_is_on_agent(): l3_agents = self.get_l3_agents_for_router(router, check=False) return waiter.expect_that(l3_agent, is_in(l3_agents))
def _check_volume_properties(): volume.get() return waiter.expect_that(volume, has_properties(properties))
def _check_image_status(): self._refresh_image(image) return waiter.expect_that(image.status.lower(), equal_to(status.lower()))
def _check_volume_type(): volume.get() return waiter.expect_that(volume.volume_type, equal_to(volume_type.name))
def predicate(): list_of_vm = get_vna_vm_list(session, ip, port) return waiter.expect_that(list_of_vm, matcher)