Commit e05b95cc authored by Luke Macken's avatar Luke Macken

0.2.6

- Make the instructions less misleading
- Support TYPE_INTERFACE for API_VERSION <= 2.3
- Remove cached mirror list in the clean_hook
parent 1fae76eb
#!/usr/bin/env python
#
# Version: 0.2.5
# Version: 0.2.6
#
# A plugin for the Yellowdog Updater Modified which sorts each repo's
# mirrorlist by connection speed prior to metadata download.
# mirrorlist by connection speed prior to download.
#
# To install this plugin, just drop it into /usr/lib/yum-plugins, and
# make sure you have 'plugins=1' in your /etc/yum.conf.
# make sure you have 'plugins=1' in your /etc/yum.conf. You also need to
# create the following configuration file, if not installed through an RPM:
#
# Configuration Options
# /etc/yum/pluginconf.d/fastestmirror.conf:
# /etc/yum/pluginconf.d/fastestmirror.conf:
# [main]
# enabled=1
# verbose=1
......@@ -39,11 +39,12 @@ import urlparse
import datetime
import threading
from yum.plugins import TYPE_INTERACTIVE, TYPE_CORE
from yum.plugins import PluginYumExit
from yum.plugins import TYPE_INTERACTIVE, TYPE_CORE, API_VERSION
from yum.plugins import TYPE_INTERFACE, PluginYumExit
requires_api_version = '2.1'
plugin_type = (TYPE_INTERACTIVE, TYPE_CORE)
requires_api_version = '2.5'
plugin_type = (API_VERSION <= 2.3 and TYPE_INTERFACE or TYPE_INTERACTIVE,
TYPE_CORE)
verbose = False
socket_timeout = 3
......@@ -62,6 +63,11 @@ def init_hook(conduit):
if os.path.exists(hostfilepath) and get_hostfile_age() < maxhostfileage:
loadcache = True
def clean_hook(conduit):
if os.path.exists(hostfilepath):
conduit.info(2, "Cleaning up list of fastest mirrors")
os.unlink(hostfilepath)
def postreposetup_hook(conduit):
global loadcache
if loadcache:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment