MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / write_file_to_tar

Method write_file_to_tar

bbot/modules/docker_pull.py:188–194  ·  view source on GitHub ↗
(self, tar, filename, file_content)

Source from the content-addressed store, hash-verified

186 return blob, filename
187
188 async def write_file_to_tar(self, tar, filename, file_content):
189 if filename and file_content:
190 file_io = io.BytesIO(file_content)
191 file_info = tarfile.TarInfo(name=filename)
192 file_info.size = len(file_io.getvalue())
193 file_io.seek(0)
194 tar.addfile(file_info, file_io)
195
196 async def download_docker_repo(self, repository_url):
197 registry, repository = self.get_registry_and_repository(repository_url)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected