Repository :
http://git.fedorahosted.org/cgit/
On branch : master
---------------------------------------------------------------
commit 4398137fcbc4e24a49b0c8251a9f97368ca5e81a
Author: Matt Domsch <matt(a)domsch.com>
Date: Thu Dec 12 14:22:38 2013 -0600
fix mirrorlist pickle generation
it was failing to look up a parent directory, which is odd, as the parent
should have been seen first. in reality, we don't care about
the ordered_mirrorlist setting for much of anything, especially
non-repository directories, so, just nuke that lookup.
move the parent_dir() function to lib.py.
---------------------------------------------------------------
server/mirrormanager/lib.py | 8 ++++++++
server/mirrormanager/mirrorlist.py | 8 +-------
server/update-master-directory-list | 11 +----------
3 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/server/mirrormanager/lib.py b/server/mirrormanager/lib.py
index e0fc6e0..b78884a 100644
--- a/server/mirrormanager/lib.py
+++ b/server/mirrormanager/lib.py
@@ -120,3 +120,11 @@ def project_dict(formname, template_engine="kid", **kw):
d['tg_template'] = "%s:%s" % (template_engine, template)
d.update(**kw)
return d
+
+def parent_dir(path):
+ sdir = path.split('/')[:-1]
+ try:
+ parent = os.path.join(*sdir)
+ except TypeError: #
+ parent = u''
+ return parent
diff --git a/server/mirrormanager/mirrorlist.py b/server/mirrormanager/mirrorlist.py
index ca45a1e..e67c9c2 100644
--- a/server/mirrormanager/mirrorlist.py
+++ b/server/mirrormanager/mirrorlist.py
@@ -4,7 +4,7 @@ from IPy import IP
import hashlib
import pprint
import dns.resolver
-from mirrormanager.lib import append_value_to_cache
+from mirrormanager.lib import append_value_to_cache, parent_dir
global_caches = dict(
# key is directoryname
@@ -141,12 +141,6 @@ def populate_directory_cache():
# any of them will do, so just look at the first one
category_id = directory_category_cache[directory_id][0]
- # repodata/ directories aren't themselves repositories, their parent dir
is
- # we're walking the list in order, so the parent will be added to the
cache before the child
- if directoryname.endswith('/repodata'):
- parent = os.path.dirname(directoryname) # parent
- cache[directoryname]['ordered_mirrorlist'] =
cache[parent]['ordered_mirrorlist']
-
cache[directoryname]['subpath'] =
directoryname[category_topdir_cache[category_id]:]
del repo
diff --git a/server/update-master-directory-list b/server/update-master-directory-list
index 43006a5..48fd087 100755
--- a/server/update-master-directory-list
+++ b/server/update-master-directory-list
@@ -23,7 +23,7 @@ from turbogears import config
sys.path.append('/usr/share/mirrormanager/server')
from mirrormanager.model import *
from mirrormanager.repomap import *
-from mirrormanager.lib import manage_pidfile, remove_pidfile, run_rsync
+from mirrormanager.lib import manage_pidfile, remove_pidfile, run_rsync, parent_dir
pidfile='/var/run/mirrormanager/umdl.pid'
@@ -279,15 +279,6 @@ def nuke_gone_directories(diskpath, category, excludes):
logger.info("Deleting gone directory %s" % (d.name))
d.destroySelf()
-def parent_dir(path):
- sdir = path.split('/')[:-1]
- try:
- parent = os.path.join(*sdir)
- except TypeError: #
- parent = u''
- return parent
-
-
def ctime_from_rsync(date, hms):
year, month, day = date.split('/')
hour, minute, second = hms.split(':')