Ejemplo n.º 1
0
    def _wait_until_ready(self, fw_id):
        target_states = ("ACTIVE", "CREATED")

        def _wait():
            firewall = self.client.show_firewall(fw_id)
            firewall = firewall["firewall"]
            return firewall["status"] in target_states

        if not test.call_until_true(_wait, CONF.network.build_timeout, CONF.network.build_interval):
            m = "Timed out waiting for firewall %s to reach %s state(s)" % (fw_id, target_states)
            raise exceptions.TimeoutException(m)
Ejemplo n.º 2
0
    def _wait_until_ready(self, fw_id):
        target_states = ('ACTIVE', 'CREATED')

        def _wait():
            firewall = self.client.show_firewall(fw_id)
            firewall = firewall['firewall']
            return firewall['status'] in target_states

        if not test.call_until_true(_wait, CONF.network.build_timeout,
                                    CONF.network.build_interval):
            m = ("Timed out waiting for firewall %s to reach %s state(s)" %
                 (fw_id, target_states))
            raise exceptions.TimeoutException(m)
Ejemplo n.º 3
0
    def _check_remote_connectivity(self, source, dest, should_succeed=True):
        """check ping server via source ssh connection

        :param source: RemoteClient: an ssh connection from which to ping
        :param dest: and IP to ping against
        :param should_succeed: boolean should ping succeed or not
        :returns: boolean -- should_succeed == ping
        :returns: ping is false if ping failed
        """
        def ping_remote():
            try:
                self.ping_host(source, dest)
            except lib_exc.SSHExecCommandFailed:
                LOG.warn(_LW('Failed to ping IP: %(dest)s '
                             'via a ssh connection from: %(source)s.') %
                         {'dest': dest, 'source': source})
                return not should_succeed
            return should_succeed

        return test.call_until_true(ping_remote,
                                    CONF.compute.ping_timeout, 1)