+++ This bug was initially created as a clone of Bug #1058975 +++
Running a private koji instance with createrepo-0.10.1-0.fc21.noarch
It is failing during regen-repo
I see the following:
$ /usr/libexec/kojid/mergerepos -a ppc64le -b /mnt/koji/repos/f21-build/9/ppc64le/blocklist -o /mnt/koji/tmp/tasks/15/15/repo -g /mnt/koji/repos/f21-build/9/groups/comps.xml -r file:///mnt/koji/tmp/tasks/15/15/repo_9_premerge/ -r http://9.5.211.49/ppc64le-minimal-packages/
Adding repo: file:///mnt/koji/tmp/tasks/15/15/repo_9_premerge/
Adding repo: http://9.5.211.49/ppc64le-minimal-packages/
pkg = acl-2.2.52-4.fc21.ppc64le, type (pkg) = <class 'yum.sqlitesack.YumAvailablePackageSqlite'>
__getitem__: key = 0, type (key) = <type 'int'>
Traceback (most recent call last):
File "/usr/libexec/kojid/mergerepos", line 262, in <module>
main(sys.argv[1:])
File "/usr/libexec/kojid/mergerepos", line 257, in main
merge.write_metadata()
File "/usr/libexec/kojid/mergerepos", line 237, in write_metadata
mdgen.doPkgMetadata()
File "/usr/lib/python2.7/site-packages/createrepo/__init__.py", line 406, in doPkgMetadata
if '://' in pkg: # remote
File "/usr/lib/python2.7/site-packages/yum/packages.py", line 384, in __getitem__
return getattr(self, key)
TypeError: getattr(): attribute name must be string
It is from the following code:
[root@localhost ~]# cat /usr/lib/python2.7/site-packages/createrepo/__init__.py
...
for pkg in self.conf.pkglist:
self.callback.log("pkg = %s, type (pkg) = %s" % (pkg, type (pkg)))
if "://" in pkg: # remote
...
[root@localhost ~]# cat /usr/lib/python2.7/site-packages/yum/packages.py
...
def __getitem__(self, key):
print "__getitem__: key = %s, type (key) = %s" % (key, type (key))
return getattr(self, key)
...
It looks like Python is in a loop trying to enumerate the keys given that it has passed a 0 integer.
Is that code correct? You are trying to use "in" for a substring test but relying on __getitem__ which is doing a member variable lookup.
http://docs.python.org/2/reference/datamodel.html#object.__contains__http://docs.python.org/2/reference/expressions.html#membership-test-details
--- Additional comment from Zdeněk Pavlas on 2014-01-29 04:13:45 EST ---
Hi, thanks for the report!
"if '://' in pkg:" is correct under the normal use of the pkglist option, but I've missed that passing in a package sack was kind of supported too. (Although not documented, and --update didn't apparently work anyway). Adding the early file checks broke this. Fixed upstream.
http://createrepo.baseurl.org/gitweb?p=createrepo.git;a=commitdiff;h=b8904f59773a478aedd416963ec451c678a6bb72