Skip to content

Commit

Permalink
try adding failed read
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Oct 24, 2022
1 parent 0453dad commit cbba87c
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions container_guts/main/container/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,14 @@ def export(self, image, tmpdir=None, cleanup=True):

for dirname in save_dir, export_dir:
os.makedirs(dirname)
self.call(
[
"tar",
"-xf",
export,
"--exclude=/dev",
"--exclude=/dev/*",
"-C",
export_dir,
]
)
self.call(
["tar", "-xf", save, "--exclude=/dev", "--exclude=/dev/*", "-C", save_dir]
)

try:
self.call(["tar", "-xf", "--ignore-failed-read", export, "-C", export_dir])
self.call(["tar", "-xf", "--ignore-failed-read", save, "-C", save_dir])
except:
self.call(["tar", "-xf", export, "-C", export_dir])
self.call(["tar", "-xf", save, "-C", save_dir])

return tmpdir

@ensure_container
Expand Down

0 comments on commit cbba87c

Please sign in to comment.