Wait until all devices have failover status of 'In Sync'.

        :raises: UnexpectedClusterState
188884
def _check_all_devices_in_sync(self):
        '''
        '''

        if len(self._get_devices_by_failover_status('In Sync')) != \
                len(self.devices):
            msg = "Expected all devices in group to have 'In Sync' status."
            raise UnexpectedDeviceGroupState(msg)
837858
def wait_until_gone(self, timeout=0, *args, **selectors):
        
        return self.device(**selectors).wait.gone(timeout=timeout)
573191
def failover(self, name):
        """"""
        fut = self.execute(b'FAILOVER', name)
        return wait_ok(fut)
194011
def until_not_synced(self, timeout=None):
        """"""
        yield until_any(*[r.until_not_synced() for r in dict.values(self.children)],
                        timeout=timeout)
703085
def _get_devices_by_failover_status(self, status):
        '''
        '''

        devices_with_status = []
        for device in self.devices:
            if (self._check_device_failover_status(device, status)):
                devices_with_status.append(device)
        return devices_with_status
670101
def _wait_for_completion(conn, wait_timeout, server_id):
    '''
    
    '''
    wait_timeout = time.time() + wait_timeout
    while wait_timeout > time.time():
        time.sleep(5)

        server = conn.get_server(server_id)
        server_state = server['status']['state'].lower()

        if server_state == "powered_on":
            return
        elif server_state == 'failed':
            raise Exception('Server creation failed for {0}'.format(server_id))
        elif server_state in ('active',
                              'enabled',
                              'deploying',
                              'configuring'):
            continue
        else:
            raise Exception(
                'Unknown server state {0}'.format(server_state))
    raise Exception(
        'Timed out waiting for server create completion for {0}'.format(server_id)
    )
1022641
def wait_until_connected(timeout=10)
    time_to_stop = timeout ? Time.now + timeout : nil

    return false unless wait_until_running(timeout)

    @state_mutex.synchronize do
      while true 
        if timeout
          now = Time.now
          break if (@state == ZOO_CONNECTED_STATE) || unhealthy? || (now > time_to_stop)
          delay = time_to_stop.to_f - now.to_f
          @state_cond.wait(delay)
        else
          break if (@state == ZOO_CONNECTED_STATE) || unhealthy?
          @state_cond.wait
        end
      end
    end

    connected?
  end
1149693
def _check_device_number(self, devices):
        '''
        '''

        if len(devices) < 2 or len(devices) > 4:
            msg = 'The number of devices to cluster is not supported.'
            raise ClusterNotSupported(msg)
797671
def until_not_synced(self, timeout=None):
        """"""
        not_synced_states = [state for state in self._state.valid_states
                             if state != 'synced']
        not_synced_futures = [self._state.until_state(state)
                              for state in not_synced_states]
        return until_any(*not_synced_futures, timeout=timeout)
642324
def clusterStatus(self):
        
        servers = yield self.client.keys('rhumba.server.*.heartbeat')
        
        d = {}

        now = time.time()

        for s in servers:
            sname = s.split('.', 2)[-1].rsplit('.', 1)[0]
            
            last = yield self.client.get('rhumba.server.%s.heartbeat' % sname)

            if not last:
                last = 0

            status = yield self.client.get('rhumba.server.%s.status' % sname)

            if (status == 'ready') and (now - last > 5):
                status = 'offline'

            d[sname] = {
                'lastseen': last,
                'status': status
            }

        defer.returnValue(d)
1068814
def wait_for_stateful_block_init(context, mri, timeout=DEFAULT_TIMEOUT):
    
    context.when_matches(
        [mri, "state", "value"], StatefulStates.READY,
        bad_values=[StatefulStates.FAULT, StatefulStates.DISABLED],
        timeout=timeout)
265411
def wait(self, timeout=None):
        """"""
        # Optimization for the case the Event is already set.
        if self._flag:
            return True
        hub = get_hub()
        try:
            with switch_back(timeout, lock=self._lock) as switcher:
                with self._lock:
                    # Need to check the flag again, now under the lock.
                    if self._flag:
                        return True
                    # Allow other fibers to wake us up via callback in set().
                    # The callback goes to switcher.switch directly() instead of
                    # __call__(), because the latter would try to lock our lock
                    # which is already held when callbacks are run by set().
                    handle = add_callback(self, switcher.switch)
                # See note in Lock.acquire() why we can call to hub.switch()
                # outside the lock.
                hub.switch()
        except BaseException as e:
            with self._lock:
                remove_callback(self, handle)
            if e is switcher.timeout:
                return False
            raise
        return True
1245814
def _check_type(self):
        '''
        '''

        if self.type not in self.available_types:
            msg = 'Unsupported cluster type was given: %s' % self.type
            raise DeviceGroupNotSupported(msg)
        elif self.type == 'sync-only' and self.name != 'device_trust_group':
            msg = "Management of sync-only device groups only supported for " \
                "built-in device group named 'device_trust_group'"
            raise DeviceGroupNotSupported(msg)
287369
def restart(self):
        
        command = const.CMD_RESTART
        cmd_response = self.__send_command(command)
        if cmd_response.get('status'):
            self.is_connect = False
            self.next_uid = 1
            return True
        else:
            raise ZKErrorResponse("can't restart device")
842614
public static void waitWhileState(final DeviceProxy proxy, final DevState waitState, final long timeout,
	    final long pollingTime) throws DevFailed, TimeoutException {
	final long time0 = System.currentTimeMillis();

	while (proxy.state().equals(waitState)) {
	    if (System.currentTimeMillis() - time0 > timeout) {
		throw new TimeoutException(
			"Stateutilities.waitWhileState : timeout reached while waiting end of state "
				+ TangoConst.Tango_DevStateName[waitState.value()]);
	    }
	    try {
		Thread.sleep(pollingTime);
	    } catch (final InterruptedException e) {
		// ignore
	    }
	}

    }
85938
def wait_for_ilo_after_reset(ilo_object):
    """"""

    is_ilo_up_after_reset = lambda: ilo_object.get_product_name() is not None
    is_ilo_up_after_reset.__name__ = 'is_ilo_up_after_reset'

    wait_for_operation_to_complete(
        is_ilo_up_after_reset,
        failover_exc=exception.IloConnectionError,
        failover_msg='iLO is not up after reset.'
    )
805497
def cli(env, volume_id, replicant_id, immediate):
    """"""
    block_storage_manager = SoftLayer.BlockStorageManager(env.client)

    success = block_storage_manager.failover_to_replicant(
        volume_id,
        replicant_id,
        immediate
    )

    if success:
        click.echo("Failover to replicant is now in progress.")
    else:
        click.echo("Failover operation could not be initiated.")