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()
评论列表
文章目录