Bug 978495

Summary: When creating / removing org-trusts through the api they are always bi-directional
Product: [Community] Spacewalk Reporter: Stephen Herr <sherr>
Component: APIAssignee: Stephen Herr <sherr>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.9CC: tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-26 18:24:18 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1484117    

Comment 1 Stephen Herr 2013-06-26 17:42:41 UTC
Description of problem:
It is currently possible to create / delete an org trust through the org.trusts.addTrust() and org.trusts.removeTrust() api methods. However, when you do it always creates / deletes a bi-directional trust, which is not always intended nor what the webui does. 

For example, if you tell the webui that org1 should trust org2, it creates that one trust. Org2 does not trust org1 if it did not before. However if you do that same operation through api, then both org1 would trust org2 and org2 would trust org1. That is not correct, and not what the API documentation says should happen.

How reproducible:
always

Steps to Reproduce:
1. Create two orgs, let's assume that their id's are 59 and 60

2. Run this python script:
from xmlrpclib import Server
s = Server('http://<server fqdn>/rpc/api')
token = s.auth.login('<sat-admin username>', '<password>')
org1 = 59
org2 = 60
s.org.trusts.addTrust(token, org1, org2)
#s.org.trusts.removeTrust(token, org1, org2)

3. Notice that two trusts have been added, one from org1 to org2 and another from org2 to org1

4. Run the script again, but move the comment from the remove line to the add line.

5. Notice that both trusts have been removed, not just the one we wanted removed.

Actual results:
Created / deleted trusts are always bi-directional.

Expected results:
Created / deleted trusts should be uni-directional in the direction you specified.

Comment 2 Stephen Herr 2013-06-26 18:24:18 UTC
This bug report is false. Trusts are always bi-directional. I'm not sure that makes any sense, but that's how they've always been and exactly 0 users have complained. Closing.

Comment 3 Tomas Lestach 2013-06-26 18:27:25 UTC
Yes, I also mean the trust has always been bi-directional.

Comment 4 Eric Herget 2017-09-28 18:06:47 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.