Bug 440428 - yum-fastestmirror doesn't care about -C flag
Summary: yum-fastestmirror doesn't care about -C flag
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-utils
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Luke Macken
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-04-03 14:39 UTC by Konstantin Zemlyak
Modified: 2016-09-20 02:38 UTC (History)
5 users (show)

Fixed In Version: 1.1.14-4.fc9
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-08 17:18:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Konstantin Zemlyak 2008-04-03 14:39:29 UTC
Description of problem:
yum-fastestmirror doesn't care about -C flag and tries to fetch mirrorlist even
when no network access is available, which in turn terminates yum.

Version-Release number of selected component (if applicable):
yum-utils1.1.11-1.fc8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Make sure yum and yum-utils are installed.
2. Disconnect from network (like ifdown interface)
3. yum -C list
Yum bails out while trying to get mirrorlist.
4. yum -C --noplugins list
Should work, confirming that the source of the bug is in plugin.


Actual results:
$ LANG=C yum -C list
Loading "presto" plugin
Loading "fastestmirror" plugin
Loading "security" plugin
Loading "changelog" plugin
Loading "downloadonly" plugin
Setting up and reading Presto delta metadata
No Presto metadata available for fedora
No Presto metadata available for livna
No Presto metadata available for updates
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist
http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=x86_64 error was
[Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Error: Cannot find a valid baseurl for repo: fedora


Expected results:
List of packages from local cache.

Additional info:

Comment 1 Stephen 2008-04-07 18:35:28 UTC
yum-fastestmirror should cache it's results such that two back-to-back calls to
yum list do not run the mirror check twice.

yum-fastestmirror should not be invoked at all, even if it's cache is out of
data, if the yum command does not require network access, such as yum info for
an already installed package.

yum-fastestmirror should fail silently when the network is not available. For
example, yum list may decide to check the package list if not done recently, and
this may cause yum-fastestmirror to check the mirrors if not done recently. If
the route to the internet for the local network is down, yum list should work
with the  cached list of packages, perhaps with a warning. This means that
yum-fastestmirror must be driven by the underlying yum commands need for network
access -- it cannot simply be invoked unconditionally at yum startup time.



Comment 2 Luke Macken 2008-05-15 14:05:02 UTC
I believe I fixed this issue.

Could you please test by throwing this in /usr/lib/yum-plugins

http://lmacken.fedorapeople.org/fastestmirror.py

Thanks!

Comment 3 Konstantin Zemlyak 2008-05-19 05:21:49 UTC
Tested, fails. Brought down my external network interface, then tried:

# yum -C list yum
Loading "presto" plugin
Loading "fastestmirror" plugin
Loading "security" plugin
Loading "changelog" plugin
Loading "downloadonly" plugin
Setting up and reading Presto delta metadata
No Presto metadata available for fedora
No Presto metadata available for livna
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist
http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-8&arch=x86_64 error was
[Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Error: Cannot find a valid baseurl for repo: fedora

Disabling all plugins or just fastestmirror works:

# yum -C --noplugins list yum
Installed Packages
yum.noarch                               3.2.8-2.fc8            installed

Moving "if opts.cacheonly" check before "if loadcache" fixes this.

Comment 4 Luke Macken 2008-05-20 15:11:24 UTC
Ah, thanks.  Fixed in 1e5a8cb86f744b6d38156247f16569675c0d6473

http://lmacken.fedorapeople.org/fastestmirror.py updated as well.

Comment 5 Fedora Update System 2008-05-21 12:43:08 UTC
yum-utils-1.1.14-1.fc9 has been submitted as an update for Fedora 9

Comment 6 Fedora Update System 2008-05-21 12:44:57 UTC
yum-utils-1.1.14-1.fc8 has been submitted as an update for Fedora 8

Comment 7 Fedora Update System 2008-05-22 20:37:50 UTC
yum-utils-1.1.14-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-utils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-4359

Comment 8 Luke Macken 2008-07-08 17:18:49 UTC
This has been fixed in yum-utils-1.1.14-4.fc9, which is now in the updates
repository.


Note You need to log in before you can comment on or make changes to this bug.