md = yum.repoMDObject.RepoMD('foo', '/path-to/fedora/repomd.xml')
md.dump_xml() => traceback
We parse self.tags['distro'] to a dict, but dump_xml() assumes it's
a list of 2-tuples (API users probably set it that way).
Just handle both.
---
yum/repoMDObject.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/yum/repoMDObject.py b/yum/repoMDObject.py
index 97256c6..88b82dc 100755
--- a/yum/repoMDObject.py
+++ b/yum/repoMDObject.py
@@ -234,7 +234,14 @@ class RepoMD:
for item in self.tags['repo']:
tag = """ <repo>%s</repo>\n""" % (to_xml(item))
tags += tag
- for (cpeid, item) in self.tags['distro']:
+ distro = self.tags['distro']
+ if isinstance(distro, dict):
+ lst = []
+ for cpeid in sorted(distro):
+ for item in sorted(distro[cpeid]):
+ lst.append((cpeid, item))
+ distro = lst
+ for (cpeid, item) in distro:
if cpeid:
tag = """ <distro cpeid="%s">%s</distro>\n""" % (
to_xml(cpeid, attrib=True), to_xml(item))
--
1.7.11.7
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel