Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 978495 - When creating / removing org-trusts through the api they are always bi-directional
Summary: When creating / removing org-trusts through the api they are always bi-direct...
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 1.9
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
Depends On:
Blocks: space27
TreeView+ depends on / blocked
Reported: 2013-06-26 17:40 UTC by Stephen Herr
Modified: 2017-09-28 18:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-06-26 18:24:18 UTC

Attachments (Terms of Use)

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:

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.

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