From 997909f812bbd6c65bc2adef42bfe3ca0be59338 Mon Sep 17 00:00:00 2001 From: Liu jue Date: Mon, 14 Jul 2014 12:26:58 +0800 Subject: [PATCH] Add return proper result when syncing When rsync to download server, this job should return proper result Change-Id: I2779d7b3ea3a9e14a0ffdd41a975361ef0a6d085 Fixes: #2045 --- job_sync_snapdiff.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/job_sync_snapdiff.py b/job_sync_snapdiff.py index c1cd501..90c3b00 100755 --- a/job_sync_snapdiff.py +++ b/job_sync_snapdiff.py @@ -112,7 +112,8 @@ def sync_world(template_name, repo_name, repo_path, **kwargs): return with open(os.path.join(reports, 'index.html'), 'w') as fp: fp.write(content) - sync(sync_out, os.path.join(os.getenv('IMG_SYNC_DEST_BASE'), repo_path)) + return sync(sync_out, os.path.join(os.getenv('IMG_SYNC_DEST_BASE'), \ + repo_path)) def main(): """The main body""" @@ -187,7 +188,7 @@ def main(): context['images'].pop(item['name']) # sync all - sync_world('index.html', repo_name, repo_path, **context) + return sync_world('index.html', repo_name, repo_path, **context) if __name__ == '__main__': sys.exit(main()) -- 2.7.4