Bug 772668

Summary: Error while fetching org subscriptions when RH repos synced
Product: [Retired] Katello Reporter: Kedar Bidarkar <kbidarka>
Component: Webservice APIAssignee: Garik Khachikyan <gkhachik>
Status: CLOSED WORKSFORME QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0CC: mkoci
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: 2012-01-13 11:27:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Kedar Bidarkar 2012-01-09 15:27:02 UTC
Description of problem:

[root@xxxxxl katello]# katello --username admin --password admin org subscriptions --name ACME_Corporation
error: 'NoneType' object is not iterable (more in the log file)



2012-01-09 14:51:43,241 [ERROR][MainThread] error() @ base.py:184 - 'NoneType' object is not iterable
2012-01-09 14:51:43,316 [ERROR][MainThread] error() @ base.py:185 - Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/katello/client/cli/base.py", line 226, in main
    return command.main(command_args)
  File "/usr/lib/python2.6/site-packages/katello/client/core/base.py", line 149, in main
    return action.main(args[1:])
  File "/usr/lib/python2.6/site-packages/katello/client/core/base.py", line 358, in main
    return self.run()
  File "/usr/lib/python2.6/site-packages/katello/client/core/organization.py", line 203, in run
    updated_pool_info = [self.displayable_pool(pool) for pool in pools]
  File "/usr/lib/python2.6/site-packages/katello/client/core/organization.py", line 232, in displayable_pool
    p = dict(list(pool.items()) + list(self.sla(pool).items()))
  File "/usr/lib/python2.6/site-packages/katello/client/core/organization.py", line 219, in sla
    return {'sla': self.extract_sla_from_product(self.productApi.show(pool['productId']))}
  File "/usr/lib/python2.6/site-packages/katello/client/core/organization.py", line 228, in extract_sla_from_product
    sla_attr = [attr.get("value", "") for attr in p["attributes"] if attr.get("name", "") == "sla"]
TypeError: 'NoneType' object is not iterable


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


How reproducible:

Reproducible when RH repos are synced and fetching org subscriptions.

I have another org called KED_Corporation on the same katello server (only fedora14 repo synced) and it fetches org subscriptions successfully.

[root@XXXX katello]# katello --username admin --password admin org subscriptions --name KED_Corporation
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                          Organization's Subscriptions
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ProductName:    fed14
Consumed:       0
ContractNumber: 
Sla:            
Id:             8ac149d334a786380134b0ca416700c6
StartDate:      2012/01/06 00:00:00
EndDate:        2041/12/29 00:00:00


Steps to Reproduce:
1.
2.
3.
  
Actual results:

Face the above error, when  fetching org subscriptions when RH repos synced

Expected results:

Should fetch org subscriptions for RH and fedora repos

Additional info:


My setup :

ACME Corporation : RHEL 6Server , fedora15, fedora16 synced

KED_Corporation : fedora14