Bug 801114

Summary: Logic for handling orphan packages should account for sub directories
Product: [Retired] Pulp Reporter: Pradeep Kilambi <pkilambi>
Component: user-experienceAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: omaciel, tsanders
Target Milestone: ---Keywords: Triaged
Target Release: Sprint 34   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 801090 Environment:
Last Closed: 2012-05-25 14:14:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 801090    
Bug Blocks:    

Comment 1 John Matthews 2012-04-17 13:12:41 UTC
Issue was with local syncs and how we handled the case of an existing package on the local filesystem but no longer in the source repo....this would break when the package was under a sub directory.

Fixed by removing the orphan logic from the local sync, allowing the removal to take place in repo_sync.py

Added a unit test to duplicate this issue:
nosetests test_repo_sync:TestRepoSync.test_local_sync_orphaned_package


Commit in pulp_v1 branch:
http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=c0d6c66ef0272347f1f7abcdcda27678f6b06250

Comment 2 Jeff Ortel 2012-04-19 15:44:38 UTC
build: 1.1.3

Comment 3 Preethi Thomas 2012-04-20 19:54:48 UTC
verified

[root@pulp-v1-1-server ~]# rpm -q pulp
pulp-1.1.3-1.fc16.noarch


<jmatthews> 1) create a small local repo
<jmatthews> 2) add a few subdirs, so something line a/pkg1.rpm  b/pkg2.rpm
<jmatthews> 3) run createrepo so it's a valid repo
<jmatthews> 4) do a pulp local sync from this local repo
<jmatthews> 5) remove one of the pkgs from the local repo
<jmatthews> 6) resync

[root@pulp-v1-1-server ~]# pulp-admin -u admin -p admin repo create --id=local --feed=file:///tmp/local-repo/
Successfully created repository [ local ]

[root@pulp-v1-1-server ~]# pulp-admin repo sync --id=local -F
Sync for repository local started
Sync: Finished
2/2 new items downloaded
0/2 existing items processed

Item Details: 
RPMs: 2/2

[root@pulp-v1-1-server ~]# cd /tmp/local-repo/
[root@pulp-v1-1-server local-repo]# ls
a  b  repodata

[root@pulp-v1-1-server local-repo]# cd a/


[root@pulp-v1-1-server a]# cd ..
[root@pulp-v1-1-server local-repo]# rm -rf a/gofer-0.66-1.fc16.noarch.rpm 


root@pulp-v1-1-server ~]# createrepo /tmp/local-repo/
Spawning worker 0 with 1 pkgs
Workers Finished
Gathering worker results

Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

[root@pulp-v1-1-server ~]# 
[root@pulp-v1-1-server ~]#  pulp-admin repo sync --id=local -F
Sync for repository local started
Sync: Finished
0/1 new items downloaded
1/1 existing items processed

Item Details: 
RPMs: 1/1

Comment 4 Preethi Thomas 2012-05-25 14:14:54 UTC
Pulp v1.1 Release