|
9 | 9 | import uuid |
10 | 10 | import base64 |
11 | 11 | import traceback |
12 | | -import requests |
13 | 12 |
|
14 | 13 | from pyinfrabox.infrabox import validate_json |
15 | 14 | from pyinfrabox.docker_compose import create_from |
@@ -131,12 +130,20 @@ def flush(self): |
131 | 130 | self.console.flush() |
132 | 131 |
|
133 | 132 | def compress(self, source, output): |
134 | | - subprocess.check_call("tar cf - --directory %s . | pigz -n > %s" % (source, output), shell=True) |
| 133 | + try: |
| 134 | + cmd = ["tar", "cf", output, "."] |
| 135 | + subprocess.check_call(cmd, cwd=source) |
| 136 | + except subprocess.CalledProcessError as e: |
| 137 | + self.console.collect(e.output) |
| 138 | + raise |
135 | 139 |
|
136 | | - def uncompress(self, source, output, c): |
137 | | - cmd = "pigz -dc %s | tar x -C %s" % (source, output) |
138 | | - c.collect(cmd, show=True) |
139 | | - subprocess.check_call(cmd, shell=True) |
| 140 | + def uncompress(self, source, output): |
| 141 | + try: |
| 142 | + cmd = ["tar", "xf", source] |
| 143 | + subprocess.check_call(cmd, cwd=output) |
| 144 | + except subprocess.CalledProcessError as e: |
| 145 | + self.console.collect(e.output) |
| 146 | + raise |
140 | 147 |
|
141 | 148 | def get_files_in_dir(self, d, ending=None): |
142 | 149 | result = [] |
@@ -479,7 +486,7 @@ def main_run_job(self): |
479 | 486 | c.collect("output found for %s\n" % dep['name'], show=True) |
480 | 487 | infrabox_input_dir = os.path.join(self.infrabox_inputs_dir, dep['name'].split('/')[-1]) |
481 | 488 | os.makedirs(infrabox_input_dir) |
482 | | - self.uncompress(storage_input_file_tar, infrabox_input_dir, c) |
| 489 | + self.uncompress(storage_input_file_tar, infrabox_input_dir) |
483 | 490 | c.execute(['ls', '-alh', infrabox_input_dir], show=True) |
484 | 491 | os.remove(storage_input_file_tar) |
485 | 492 | else: |
|
0 commit comments