示例#1
0
 def create_rest_client(self, **kwargs):
     params = {
         'host': self.env.container_ip,
         'cert_path': self.ca_cert,
         **kwargs
     }
     return utils.create_rest_client(**params)
示例#2
0
def _wait_for_services(container_ip=None):
    if container_ip is None:
        container_ip = utils.get_manager_ip()
    logger.info('Waiting for RabbitMQ')
    _retry(func=utils.create_pika_connection,
           exceptions=AMQPConnectionError,
           cleanup=lambda conn: conn.close())
    logger.info('Waiting for REST service and Storage')
    rest_client = utils.create_rest_client()
    _retry(func=rest_client.blueprints.list,
           exceptions=(requests.exceptions.ConnectionError,
                       cloudify_rest_client.exceptions.CloudifyClientError))
    logger.info('Waiting for postgres')
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    _retry(func=lambda: sock.connect((container_ip, 5432)),
           cleanup=lambda _: sock.close(),
           exceptions=IOError)
示例#3
0
def _wait_for_services(container_ip=None):
    if container_ip is None:
        container_ip = utils.get_manager_ip()
    logger.info('Waiting for RabbitMQ')
    _retry(func=utils.create_pika_connection,
           exceptions=AMQPConnectionError,
           cleanup=lambda conn: conn.close())
    logger.info('Waiting for REST service and Storage')
    rest_client = utils.create_rest_client()
    _retry(func=rest_client.blueprints.list,
           exceptions=(requests.exceptions.ConnectionError,
                       cloudify_rest_client.exceptions.CloudifyClientError))
    logger.info('Waiting for postgres')
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    _retry(func=lambda: sock.connect((container_ip, 5432)),
           cleanup=lambda _: sock.close(),
           exceptions=IOError)
示例#4
0
 def _setup_running_manager_attributes(self):
     self.client = utils.create_rest_client()