Bug 972146 - if org name is altered in satellite, sst will not sync orgs
if org name is altered in satellite, sst will not sync orgs
Status: CLOSED ERRATA
Product: Subscription Asset Manager
Classification: Red Hat
Component: Splice (Show other bugs)
1.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Chris Duryee
mkovacik
:
Depends On:
Blocks: sam13-tracker
  Show dependency treegraph
 
Reported: 2013-06-07 15:33 EDT by Chris Duryee
Modified: 2013-10-01 07:11 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-01 07:11:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Duryee 2013-06-07 15:33:21 EDT
Description of problem: If an org name is changed in satellite, sst will not be able to find the matching org's roles in sam.


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


How reproducible: every time


Steps to Reproduce:
1. do a successful --spacewalk-sync
2. change an org name
3. run --spacewalk-sync again

Actual results:
2013-06-07 19:28:31,196 ERROR spacewalk_splice_tool.katello_connect katello_connect:grantOrgAdmin: could not obtain org admin role from katello for org Red Hat (Internal Use Only)!
Traceback (most recent call last):
  File "/usr/bin/spacewalk-splice-checkin", line 72, in <module>
    checkin.main(opts)
  File "/usr/lib/python2.6/site-packages/spacewalk_splice_tool/checkin.py", line 575, in main
    spacewalk_sync(options)
  File "/usr/lib/python2.6/site-packages/spacewalk_splice_tool/checkin.py", line 512, in spacewalk_sync
    update_roles(katello_client, sw_user_list)
  File "/usr/lib/python2.6/site-packages/spacewalk_splice_tool/checkin.py", line 345, in update_roles
    kt_user=kt_users[kt_username], kt_org_name = sw_user_org)
  File "/usr/lib/python2.6/site-packages/spacewalk_splice_tool/katello_connect.py", line 223, in grantOrgAdmin
    self.userapi.assign_role(user_id=kt_user['id'], role_id=oa_role['id'])
TypeError: 'NoneType' object is unsubscriptable



Expected results: successful sync
Comment 1 Chris Duryee 2013-06-07 15:46:05 EDT
forgot to mention, the org name change to cause the bug is in spacewalk, not katello. Also, if the "root org" changes as the result of a new cert being imported, then syncs cannot be performed until the user runs katello-configure --reset-data=YES, since the root org's name can't be altered in the UI.
Comment 2 Chris Duryee 2013-06-10 17:01:07 EDT
fixed in c99c8b01e0f775356dde90a406d790479f580ef2, spacewalk-splice-tool

it will show up in version 0.20+
Comment 4 Vitaly Kuznetsov 2013-06-18 07:33:07 EDT
After the fix SST is not blowing up, but the organization is not being renamed.

1) Initial data is spacewalk:
# spacewalk-report users
organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active
1,Spacewalk Default Organization,1,admin,Admin,Admin,,root@localhost,Organization Administrator;Satellite Administrator,2013-06-18 07:11:46,,enabled
2,Org1,2,adminorg1,Adminorg1,Adminorg1,,adminorg1@localhost,Organization Administrator,2013-06-18 07:19:08,,enabled


2) running sst:
# spacewalk-splice-checkin 
2013-06-18 07:27:30,446 INFO splice.common.connect connect:_request: Sending 'POST' to '/splice/api//v1/spliceserver/' 
	with headers '{'Content-type': 'application/json', 'Accept': 'application/json'}'
2013-06-18 07:27:31,013 INFO splice.common.connect connect:_request: Received '204' from 'POST /splice/api//v1/spliceserver/'
2013-06-18 07:27:31,014 INFO splice.common.connect connect:_request: Sending 'POST' to '/splice/api//v1/marketingproductusage/' 
	with headers '{'Content-type': 'application/json', 'Accept': 'application/json'}'
2013-06-18 07:27:31,104 INFO splice.common.connect connect:_request: Received '204' from 'POST /splice/api//v1/marketingproductusage/'
Upload was successful

3) Now I can see these orgs in Katello:
[{u'apply_info_task_id': None,
  u'created_at': u'2013-06-18T11:27:20Z',
  u'default_info': {u'distributor': [], u'system': []},
  u'deletion_task_id': None,
  u'description': u'no description',
  u'id': 3,
  u'label': u'satellite-2',
  u'name': u'Org1',
  u'service_level': None,
  u'service_levels': [],
  u'updated_at': u'2013-06-18T11:27:20Z'},
 {u'apply_info_task_id': None,
  u'created_at': u'2013-06-18T11:27:18Z',
  u'default_info': {u'distributor': [], u'system': []},
  u'deletion_task_id': None,
  u'description': u'no description',
  u'id': 2,
  u'label': u'satellite-1',
  u'name': u'Spacewalk Default Organization',
  u'service_level': None,
  u'service_levels': [],
  u'updated_at': u'2013-06-18T11:27:18Z'},
 {u'apply_info_task_id': None,
  u'created_at': u'2013-06-18T11:23:25Z',
  u'default_info': {u'distributor': [], u'system': []},
  u'deletion_task_id': None,
  u'description': u'ACME_Corporation Organization',
  u'id': 1,
  u'label': u'ACME_Corporation',
  u'name': u'ACME_Corporation',
  u'service_level': None,
  u'service_levels': [],
  u'updated_at': u'2013-06-18T11:23:25Z'}]

4) renaming org in spacewalk (Org1 -> Org1_renamed):
# spacewalk-report users
organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active
1,Spacewalk Default Organization,1,admin,Admin,Admin,,root@localhost,Organization Administrator;Satellite Administrator,2013-06-18 07:11:46,,enabled
2,Org1_renamed,2,adminorg1,Adminorg1,Adminorg1,,adminorg1@localhost,Organization Administrator,2013-06-18 07:19:08,,enabled

5) running SST again
# spacewalk-splice-checkin 
2013-06-18 07:28:43,018 INFO splice.common.connect connect:_request: Sending 'POST' to '/splice/api//v1/spliceserver/' 
	with headers '{'Content-type': 'application/json', 'Accept': 'application/json'}'
2013-06-18 07:28:43,112 INFO splice.common.connect connect:_request: Received '204' from 'POST /splice/api//v1/spliceserver/'
2013-06-18 07:28:43,113 INFO splice.common.connect connect:_request: Sending 'POST' to '/splice/api//v1/marketingproductusage/' 
	with headers '{'Content-type': 'application/json', 'Accept': 'application/json'}'
2013-06-18 07:28:43,200 INFO splice.common.connect connect:_request: Received '204' from 'POST /splice/api//v1/marketingproductusage/'
Upload was successful

6) Checking Katello:
[{u'apply_info_task_id': None,
  u'created_at': u'2013-06-18T11:27:20Z',
  u'default_info': {u'distributor': [], u'system': []},
  u'deletion_task_id': None,
  u'description': u'no description',
  u'id': 3,
  u'label': u'satellite-2',
  u'name': u'Org1',
  u'service_level': None,
  u'service_levels': [],
  u'updated_at': u'2013-06-18T11:27:20Z'},
 {u'apply_info_task_id': None,
  u'created_at': u'2013-06-18T11:27:18Z',
  u'default_info': {u'distributor': [], u'system': []},
  u'deletion_task_id': None,
  u'description': u'no description',
  u'id': 2,
  u'label': u'satellite-1',
  u'name': u'Spacewalk Default Organization',
  u'service_level': None,
  u'service_levels': [],
  u'updated_at': u'2013-06-18T11:27:18Z'},
 {u'apply_info_task_id': None,
  u'created_at': u'2013-06-18T11:23:25Z',
  u'default_info': {u'distributor': [], u'system': []},
  u'deletion_task_id': None,
  u'description': u'ACME_Corporation Organization',
  u'id': 1,
  u'label': u'ACME_Corporation',
  u'name': u'ACME_Corporation',
  u'service_level': None,
  u'service_levels': [],
  u'updated_at': u'2013-06-18T11:23:25Z'}]

So Org1 was not renamed to Org1_renamed as expected.
Comment 5 Vitaly Kuznetsov 2013-06-18 09:10:57 EDT
Actually now we're seeing https://bugzilla.redhat.com/show_bug.cgi?id=972942 so I can set this one to 'VERIFIED'
Comment 8 errata-xmlrpc 2013-10-01 07:11:48 EDT
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.

http://rhn.redhat.com/errata/RHEA-2013-1390.html

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