Bug 1094202

Summary: Deleting repository is not possible
Product: Red Hat Satellite 6 Reporter: Matej Kollar <mkollar>
Component: APIAssignee: David Davis <daviddavis>
Status: CLOSED CURRENTRELEASE QA Contact: sthirugn <sthirugn>
Severity: high Docs Contact:
Priority: unspecified    
Version: NightlyCC: cperry, cwelton, jmontleo, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-11 12:29:42 UTC Type: Bug
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: 1100311    
Bug Blocks:    

Description Matej Kollar 2014-05-05 09:50:33 UTC
Description of problem: After deleting organization in which is product containing repository, it is not possible to delete repository, even if you know Id. Howeverm, it looks like it works...



Steps to Reproduce:
1. Create org, in org product and in product repo
2. (Sync repo, this step may not be necessary)
3. Delete organization.

Actual results:
# hammer -v repository delete --id 5
Repository deleted
# hammer -v repository delete --id 5
Repository deleted
# hammer -v repository delete --id 5
Repository deleted


Expected results:
Repo should be gone after first call...

Comment 1 RHEL Program Management 2014-05-05 09:54:44 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Brad Buckingham 2014-06-25 15:28:29 UTC
This issue should no longer exist once the org deletion issues are addressed; however, assigning to David to ensure that it is.

Comment 4 David Davis 2014-07-16 20:17:47 UTC
Confirmed as working as part of https://bugzilla.redhat.com/show_bug.cgi?id=1100311. QA, please verify.

Comment 6 sthirugn@redhat.com 2014-08-10 15:13:40 UTC
hammer> organization create --name='deleteorg'
Organization created

hammer> product create --name='testproduct' --organization='deleteorg'
Product created

hammer> product list --organization='deleteorg'
---|-------------|-------------|--------------|--------------|-----------
ID | NAME        | DESCRIPTION | ORGANIZATION | REPOSITORIES | SYNC STATE
---|-------------|-------------|--------------|--------------|-----------
96 | testproduct |             | deleteorg    | 0            | not_synced
---|-------------|-------------|--------------|--------------|-----------

hammer> repository create --name='testrepo' --product-id=96 --organization-id=4 --content-type=yum
Repository created

hammer> repository list --product-id=96 --organization-id=4
---|----------|-------------|--------------|----
ID | NAME     | PRODUCT     | CONTENT TYPE | URL
---|----------|-------------|--------------|----
24 | testrepo | testproduct | yum          |    
---|----------|-------------|--------------|----

hammer> repository update --url='$url' --id=24 --organization-id=4
Repository updated

hammer> repository synchronize --id=24 --organization-id=4
[..................................................................................................] [100%]
Task be41773f-0324-4208-b3a9-b5eff8dbe077: success
No new packages.

hammer> organization delete --id=4
[..................................................................................................] [100%]
Task 6f804d77-a000-4c68-9373-c9415a1cccd2: success

hammer> product list --organization-id=4
Couldn't find organization '4'

hammer> product info --id=96 --organization-id=4
no resource loaded

hammer> repository delete --id=24
Could not delete the Repository:
  Couldn't find Katello::Repository with id=24

A new issue https://bugzilla.redhat.com/show_bug.cgi?id=1128459 is created to track the following issue 

hammer> product delete --id=96
Could not destroy the product:
  undefined method `user_deletable?' for nil:NilClass

Comment 8 Bryan Kearney 2014-09-11 12:29:42 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.