diff options
Diffstat (limited to 'fast_downloader.py')
-rw-r--r-- | fast_downloader.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fast_downloader.py b/fast_downloader.py index da6bf9f..d48c1dc 100644 --- a/fast_downloader.py +++ b/fast_downloader.py @@ -60,7 +60,9 @@ def _getAria2CArgs(urls, remote_path, local_path, proxies = None): def downloadFile(urls, remote_path, local_path, proxies = None): if urls[0].startswith("http://") or urls[0].startswith("ftp://"): args = _getAria2CArgs(urls, remote_path, local_path) - os.spawnvp(os.P_WAIT, downloader_app, args) + ret = os.spawnvp(os.P_WAIT, downloader_app, args) + if ret: + raise yum.plugins.PluginYumExit("{0} exited with exit code: {1}".format(downloader_app, ret)) def queueDownload(inputFile, urls, remote_path, local_path, proxies = None): if urls[0].startswith("http://") or urls[0].startswith("ftp://"): @@ -84,7 +86,9 @@ def downloadQueuedFiles(inputFileName): args.append("--server-stat-of={0}/aria2c_server_stats".format(global_cache_dir)) args.append("--max-concurrent-downloads=5") args.append("--input-file={0}".format(inputFileName)) - os.spawnvp(os.P_WAIT, "aria2c", args) + ret = os.spawnvp(os.P_WAIT, "aria2c", args) + if ret: + raise yum.plugins.PluginYumExit("{0} exited with exit code: {1}".format(downloader_app, ret)) # Hooks! |