diff options
Diffstat (limited to 'yum-fast-downloader.py')
-rw-r--r-- | yum-fast-downloader.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/yum-fast-downloader.py b/yum-fast-downloader.py index d3aa9cb..9a9ceae 100644 --- a/yum-fast-downloader.py +++ b/yum-fast-downloader.py @@ -28,6 +28,7 @@ import shutil import yum from yum.plugins import TYPE_CORE from yum.yumRepo import YumRepository +from time import sleep requires_api_version = '2.6' plugin_type = (TYPE_CORE,) @@ -65,6 +66,13 @@ def downloadFile(urls, remote_path, local_path, proxies = None): if ret: raise yum.plugins.PluginYumExit( "{0} exited with exit code: {1}".format(downloader_app, ret)) + i=0 + while not os.path.exists(local_path): + sleep(0.1) + i+=1 + if i > 50: + raise yum.plugins.PluginYumExit( + "Error in downloading file: {0}".format(local_path)) def queueDownload(inputFile, urls, remote_path, local_path, proxies = None): if urls[0].startswith("http://") or urls[0].startswith("ftp://"): |