Пример #1
0
 def check_connection(self):
     msg = service_pb2.CheckConnectionRequest(auth_info=self._auth_info)
     response = self._client.CheckConnection(
         request=msg,
         metadata=self._get_metadata(),
         timeout=Envs.GRPC_CLIENT_TIMEOUT)
     if response.status.code != common_pb2.STATUS_SUCCESS:
         logging.debug('check_connection request error: %s',
                       response.status.msg)
     return response
Пример #2
0
 def check_connection(self):
     msg = service_pb2.CheckConnectionRequest(
         auth_info=service_pb2.FedAuthInfo(
             federation_name=self._federation.federation_name,
             sender_name=self._federation.self_name,
             receiver_name=self._receiver.name,
             auth_token=self._receiver.sender_auth_token))
     try:
         return self._client.CheckConnection(msg).status
     except Exception as e:
         return common_pb2.Status(code=common_pb2.STATUS_UNKNOWN_ERROR,
                                  msg=repr(e))
Пример #3
0
 def check_connection(self):
     msg = service_pb2.CheckConnectionRequest(auth_info=self._auth_info)
     try:
         response = self._client.CheckConnection(
             request=msg, metadata=self._get_metadata())
         if response.status.code != common_pb2.STATUS_SUCCESS:
             logging.debug('check_connection request error: %s',
                           response.status.msg)
         return response.status
     except Exception as e:
         logging.debug('check_connection request error: %s', repr(e))
         return common_pb2.Status(code=common_pb2.STATUS_UNKNOWN_ERROR,
                                  msg=repr(e))
Пример #4
0
 def check_connection(self):
     msg = service_pb2.CheckConnectionRequest(
         auth_info=service_pb2.ProjAuthInfo(
             project_name=self._project.project_name,
             sender_name=self._project.self_name,
             receiver_name=self._receiver.name,
             auth_token=self._receiver.sender_auth_token))
     try:
         response = self._client.CheckConnection(
             request=msg, metadata=self._get_metadata())
         return response.status
     except Exception as e:
         return common_pb2.Status(code=common_pb2.STATUS_UNKNOWN_ERROR,
                                  msg=repr(e))