Skip to content

Commit b3aa64b

Browse files
committed
fix tar command
1 parent 1dbaec3 commit b3aa64b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/job/job.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import uuid
1010
import base64
1111
import traceback
12-
import requests
1312

1413
from pyinfrabox.infrabox import validate_json
1514
from pyinfrabox.docker_compose import create_from
@@ -132,15 +131,15 @@ def flush(self):
132131

133132
def compress(self, source, output):
134133
try:
135-
subprocess.check_call("tar cf %s ." % output, cwd=source)
134+
cmd = ["tar", "cf", output, "."]
135+
subprocess.check_call(cmd, cwd=source)
136136
except subprocess.CalledProcessError as e:
137137
self.console.collect(e.output)
138138
raise
139139

140-
def uncompress(self, source, output, c):
140+
def uncompress(self, source, output):
141141
try:
142-
cmd = "tar xf %s" % source
143-
c.collect(cmd, show=True)
142+
cmd = ["tar", "xf", source]
144143
subprocess.check_call(cmd, cwd=output)
145144
except subprocess.CalledProcessError as e:
146145
self.console.collect(e.output)
@@ -487,7 +486,7 @@ def main_run_job(self):
487486
c.collect("output found for %s\n" % dep['name'], show=True)
488487
infrabox_input_dir = os.path.join(self.infrabox_inputs_dir, dep['name'].split('/')[-1])
489488
os.makedirs(infrabox_input_dir)
490-
self.uncompress(storage_input_file_tar, infrabox_input_dir, c)
489+
self.uncompress(storage_input_file_tar, infrabox_input_dir)
491490
c.execute(['ls', '-alh', infrabox_input_dir], show=True)
492491
os.remove(storage_input_file_tar)
493492
else:

0 commit comments

Comments
 (0)