Esempio n. 1
0
  def dial(self):
    if self.stub:
      self.stub.close()

    p = urlparse('http://' + self.addr)
    channel = implementations.insecure_channel(p.hostname, p.port)
    self.stub = vtgateservice_pb2.beta_create_Vitess_stub(channel)
Esempio n. 2
0
    def dial(self):
        if self.stub:
            self.stub.close()

        p = urlparse('http://' + self.addr)
        channel = implementations.insecure_channel(p.hostname, p.port)
        self.stub = vtgateservice_pb2.beta_create_Vitess_stub(channel)
Esempio n. 3
0
  def dial(self):
    if self.stub:
      self.stub.close()

    p = urlparse('http://' + self.addr)

    if self.root_certificates or self.private_key or self.certificate_chain:
      creds = implementations.ssl_channel_credentials(
          self.root_certificates, self.private_key, self.certificate_chain)
      channel = implementations.secure_channel(p.hostname, p.port, creds)
    else:
      channel = implementations.insecure_channel(p.hostname, p.port)
    self.stub = vtgateservice_pb2.beta_create_Vitess_stub(channel)
Esempio n. 4
0
  def dial(self):
    if self.stub:
      self.stub.close()

    p = urlparse('http://' + self.addr)

    if self.root_certificates or self.private_key or self.certificate_chain:
      creds = implementations.ssl_channel_credentials(
          self.root_certificates, self.private_key, self.certificate_chain)
      channel = implementations.secure_channel(p.hostname, p.port, creds)
    else:
      channel = implementations.insecure_channel(p.hostname, p.port)
    self.stub = vtgateservice_pb2.beta_create_Vitess_stub(channel)