summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2017-07-20 02:18:16 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-20 02:18:16 +0000
commit83bc05805c9734d3bd93c6a8da8c4f7d0a73955c (patch)
treea521897af39e44a63ca37ce58150896fc3e2ab2a
parent657249dad1bfee6fc190d0c63cf46a1ddfb9cad1 (diff)
parent25467945c3331f4c3db37d9fafbd3a2f70de93e0 (diff)
Merge "To judge download is successful or not"
-rw-r--r--build/parser.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/build/parser.py b/build/parser.py
index 63eb494f..b80709cb 100644
--- a/build/parser.py
+++ b/build/parser.py
@@ -43,7 +43,9 @@ def get_from_cache(cache, package):
print "downloading remote file to local...."
cmd = "curl --connect-timeout 10 -o " + localfile + " " + remotefile
print cmd
- os.system(cmd)
+ rc = os.system(cmd)
+ if rc != 0:
+ sys.exit(1)
def get_from_git(cache, package):
@@ -53,7 +55,9 @@ def get_from_git(cache, package):
os.system(cmd)
cmd = "git clone " + package.get("url") + " " + localfile
print cmd
- os.system(cmd)
+ rc = os.system(cmd)
+ if rc != 0:
+ sys.exit(1)
def get_from_docker(cache, package):
@@ -61,14 +65,18 @@ def get_from_docker(cache, package):
os.system(cmd)
cmd = "sudo docker save "+package.get("url")+" -o "+cache+"/"
cmd += package.get("name")+".tar"
- os.system(cmd)
+ rc = os.system(cmd)
+ if rc != 0:
+ sys.exit(1)
def get_from_curl(cache, package):
cmd = "curl --connect-timeout 10 -o " + cache + "/"
cmd += package.get("name") + " " + package.get("url")
print cmd
- os.system(cmd)
+ rc = os.system(cmd)
+ if rc != 0:
+ sys.exit(1)
def usage():