lordgamez commented on code in PR #1669:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1669#discussion_r1338885235
##########
docker/test/integration/cluster/DockerCommunicator.py:
##########
@@ -66,3 +66,19 @@ def write_content_to_container(self, content,
container_name, dst_path):
tar.addfile(info, io.BytesIO(content.encode('utf-8')))
with open(os.path.join(td, 'content.tar'), 'rb') as data:
return self.__put_archive(container_name,
os.path.dirname(dst_path), data.read())
+
+ def copy_file_from_container(self, container_name, src_path_in_container,
dest_dir_on_host) -> bool:
+ try:
+ container = self.client.containers.get(container_name)
+ (bits, _) = container.get_archive(src_path_in_container)
+ tmp_tar_path = os.path.join(dest_dir_on_host, "tmp_debug.tar")
Review Comment:
`tmp_debug.tar` is only temporary because the python docker API only offers
retrieving a file or a folder in a single tar file. This file is deleted after
extracted. I can rename it to something more generic, as it can be used for any
file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]