[Spacewalk-list] Reposync problem

Michael Mraka michael.mraka at redhat.com
Mon Jan 4 09:23:41 UTC 2010


Paul wrote:
> Hi,
>
> I'm having trouble with Spacewalk 0.7. For some reason when I add a new  
> channel (for CentOS5.4 64 bit) with a yum repository it is unable to  
> download and sync the packages. When I run spacewalk-repo-sync manually  
> I can see it going through each package. I see the package downloaded  
> into the repo cache, but the package never makes it under  
> /var/satellite/redhat/1.
>
> After a lot of digging, I've discovered that in the below section of  
> reposync.py the pid value is not 'None' and so the self.upload_package  
> call is never performed. I have now hacked this in my version to ensure  
> the packages are properly downloaded as a temporary measure.
>
> reposync.py:
>>         for (index, pack) in enumerate(to_download):
>>             """download each package"""
>>             try:
>>                 self.print_msg(str(index+1) + "/" +  
>> str(len(to_download)) + " : "+ \
>>                       pack.getNVREA())
>>                 path = self.plugin.get_package(pack)
>>                 md5 = rhnLib.getFileMD5(filename=path)
>>                 pid =  rhnPackage.get_package_for_md5sum(
>>                                   self.channel['org_id'], md5)
>>                 if pid is None:
>>                      self.upload_package(pack, path)
>
> However, how do I do things the correct way? What is the reason for the  
> get_package_for_md5sum call and how do I get it to return 'None' so the  
> package is stored? I've checked the various documentation on the site  
> and I can't see that I've missed anything.

rhnPackage.get_package_for_md5sum returns package_id from the database.
None means package is not in the database and have to be
uploaded/inserted. Any other values - package is already there (have an
id) and has to be only associated with new channel.

So I guess you have packages in the database but they were removed from the
disk?!? 


> cheers
>
> Paul

--
Michael Mráka
Satellite Engineering, Red Hat




More information about the Spacewalk-list mailing list