fix tar command
@@ -9,7 +9,6 @@ import subprocess
import uuid
import base64
import traceback
-import requests
from pyinfrabox.infrabox import validate_json
from pyinfrabox.docker_compose import create_from
@@ -132,15 +131,15 @@ class RunJob(Job):
def compress(self, source, output):
try:
- subprocess.check_call("tar cf %s ." % output, cwd=source)
+ cmd = ["tar", "cf", output, "."]
+ subprocess.check_call(cmd, cwd=source)
except subprocess.CalledProcessError as e:
self.console.collect(e.output)
raise
- def uncompress(self, source, output, c):
+ def uncompress(self, source, output):
try:
- cmd = "tar xf %s" % source
- c.collect(cmd, show=True)
+ cmd = ["tar", "xf", source]
subprocess.check_call(cmd, cwd=output)
except subprocess.CalledProcessError as e:
self.console.collect(e.output)
@@ -487,7 +486,7 @@ class RunJob(Job):
c.collect("output found for %s\n" % dep['name'], show=True)
infrabox_input_dir = os.path.join(self.infrabox_inputs_dir, dep['name'].split('/')[-1])
os.makedirs(infrabox_input_dir)
- self.uncompress(storage_input_file_tar, infrabox_input_dir, c)
+ self.uncompress(storage_input_file_tar, infrabox_input_dir)
c.execute(['ls', '-alh', infrabox_input_dir], show=True)
os.remove(storage_input_file_tar)
else:
