Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1408940 - Cannot disassociate entities from organization
Summary: Cannot disassociate entities from organization
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.3.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Swapnil Abnave
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-28 09:59 UTC by Oleksandr Shtaier
Modified: 2019-09-26 16:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:45:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17343 0 None None None 2017-01-05 12:59:00 UTC

Description Oleksandr Shtaier 2016-12-28 09:59:14 UTC
Description of problem:
Basically, cannot disassociate any entity from organization neither by id nor by name

hammer -v -u admin -p changeme  organization add-subnet --subnet="dwGoNeFm" --name="89aE3E"
The subnet has been associated

hammer -v -u admin -p changeme  organization info --id="182"
Id:                     182
Name:                   89aE3E
...
Subnets:                
    dwGoNeFm (94.138.206.0/26)
...

hammer -v -u admin -p changeme  organization remove-subnet --subnet="dwGoNeFm" --name="89aE3E"
The subnet has been disassociated
hammer -v -u admin -p changeme  organization info --id="182"
...
Subnets:                
    dwGoNeFm (94.138.206.0/26)
...

or

hammer -v -u admin -p changeme  organization add-user --user-id="64" --id="196"
The user has been associated
hammer -v -u admin -p changeme  organization remove-user --user-id="64" --id="196"
The user has been disassociated
hammer -v -u admin -p changeme  organization info --id="196"
Id:                     196
Name:                   iVMkzf
...
Users:                  
    Rp2QHp
...

Version-Release number of selected component (if applicable):
6.3.0 SNAP8

How reproducible:
Always

Steps to Reproduce:
1. Create organization
2. Add any entity to it (user, medium, subnet, hostgroup, etc)
3. Try to remove that entity from organization

Actual results:
Entity is not disassociated

Expected results:
Entity is disassociated successfully

Additional info:

Comment 2 Marek Hulan 2017-01-02 15:48:38 UTC
Does it work from UI or API directly?

Comment 3 Tomas Strachota 2017-01-05 12:53:35 UTC
I reproduced the issue. It's API issue only, everything works in the UI.
It appears when you're removing the last item from the collection. API seems to have problems with accepting empty array and ignores the parameter.

Both sat 6.2 and current upstream master work fine.

Comment 4 Tomas Strachota 2017-01-05 13:02:18 UTC
I found out there's already an upstream issue with associated BZ dealing with this issue, closing as duplicate.

*** This bug has been marked as a duplicate of bug 1395229 ***

Comment 5 Satellite Program 2017-01-05 13:09:37 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17343 has been resolved.

Comment 6 Swapnil Abnave 2017-08-03 15:26:47 UTC
Verified Satellite 6.3 SNAP 9

* satellite-6.3.0-16.0.beta.el7sat.noarch
* foreman-1.15.2-1.el7sat.noarch
* katello-3.4.2-1.el7sat.noarch

Before:
# hammer organization info --id=3
---
Smart proxies:          
    bkr-hv01-guest06.dsal.lab.eng.bos.redhat.com
Subnets:                
    test-subnet (127.0.0.1/24)
Compute resources:      
    vCenter
---

After:
# hammer organization remove-subnet --id 3 --subnet test-subnet
# hammer organization remove-smart-proxy --id 3 --smart-proxy-id 1
# hammer organization remove-compute-resource --id 3 --compute-resource-id 1

# hammer organization info --id=3
---
Id:                     3
Name:                   nukelater
Description:            
Users:                  

Smart proxies:          

Subnets:                

Compute resources:      
---

Comment 7 Bryan Kearney 2018-02-21 16:41:56 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336

Comment 8 Bryan Kearney 2018-02-21 16:45:45 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336

Comment 9 Satellite Program 2018-02-21 16:49:54 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.