trex_client.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:trex-http-proxy 作者: alwye 项目源码 文件源码
def get_file(self, filepath):
        """
        Gets content of file as bytes string from /tmp/trex_files or TRex server directory.

        :parameters:
            filepath : str
                a path to a file at server.
                it can be either relative to TRex server or absolute path starting with /tmp/trex_files

        :return: 
            Content of the file

        :raises:
            + :exc:`trex_exceptions.TRexRequestDenied`, in case TRex is reserved for another user than the one trying to cancel the reservation.
            + ProtocolError, in case of error in JSON-RPC protocol.
        """

        try:
            return binascii.a2b_base64(self.server.get_file(filepath))
        except AppError as err:
            self._handle_AppError_exception(err.args[0])
        except ProtocolError:
            raise
        finally:
            self.prompt_verbose_data()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号