Description of problem: While trying to download a package while offline the output shows a python exception. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Update all the repo data 2. Switch networking off 3. try to dnf update or dnf install something Actual results: Is this ok [y/N]: y Downloading Packages: Traceback (most recent call last): File "/bin/dnf", line 35, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 272, in user_main errcode = main(args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 187, in _main return_code, resultmsgs = base.do_transaction() File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 185, in do_transaction self.download_callback_total_cb) File "/usr/lib/python2.7/site-packages/dnf/base.py", line 1033, in download_packages librepo.download_packages(targets) File "/usr/lib64/python2.7/site-packages/librepo/__init__.py", line 1035, in download_packages return _librepo.download_packages(list, failfast) librepo.LibrepoException: (8, "Curl error: Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=fedora-20&arch=x86_64", 'An Curl handle error') Expected results: A user friendly output stating that there is no internet connectivity Additional info:
Zdenek can you please take a look? All calls to librepo should ideally be wrapped within dnf.repo etc.
This is a bug in librepo. With failfast=False, librepo.download_packages() should not raise exception when host couldn't be resolved. Could you include the dnf version, please? We recently enabled failfast and handle LibrepoException, so it's being worked around already.
[997][aruiz@kerrigan ~]$ dnf --version 0.4.5 Installed: dnf-0:0.4.5-1.fc20.noarch at 2013-10-21 13:25 Built : Fedora Project at 2013-10-20 12:10 Installed: rpm-0:4.11.1-7.fc20.x86_64 at 2013-09-26 11:16 Built : Fedora Project at 2013-09-09 12:13
Yep, I thought so. This should be handled in 0.4.6