Repository :
http://git.fedorahosted.org/cgit/
On branch : v1.4
---------------------------------------------------------------
commit 9c312c73358fe0303edade52db371282f5c72139
Author: Matt Domsch <Matt_Domsch(a)dell.com>
Date: Sun Feb 24 22:14:23 2013 -0600
mirrorlist.py: fix broken logic that lead to tracebacks
---------------------------------------------------------------
server/mirrormanager/mirrorlist.py | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/server/mirrormanager/mirrorlist.py b/server/mirrormanager/mirrorlist.py
index 1d3651a..09c391e 100644
--- a/server/mirrormanager/mirrorlist.py
+++ b/server/mirrormanager/mirrorlist.py
@@ -131,22 +131,21 @@ def populate_directory_cache():
if repo is not None and repo.arch is not None:
global_caches['repo_arch_to_directoryname'][(repo.prefix,
repo.arch.name)] = directoryname
cache[directoryname]['ordered_mirrorlist'] =
repo.version.ordered_mirrorlist # WARNING - this is a query # fixme use cache
- category_id = directory_category_cache[directory_id]
- else:
- numcats = len(directory_category_cache.get(directory_id, []))
- if numcats == 0:
- # no category, so we can't know a mirror host's URLs.
- # nothing to add.
- continue
- elif numcats >= 1:
- # 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']
+
+ numcats = len(directory_category_cache.get(directory_id, []))
+ if numcats == 0:
+ # no category, so we can't know a mirror host's URLs.
+ # nothing to add.
+ continue
+ elif numcats >= 1:
+ # 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