Red Hat Bugzilla – Bug 978495
When creating / removing org-trusts through the api they are always bi-directional
Last modified: 2013-06-26 14:27:25 EDT
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.
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.
Created / deleted trusts are always bi-directional.
Created / deleted trusts should be uni-directional in the direction you specified.
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.
Yes, I also mean the trust has always been bi-directional.