Bug 678658

Summary: pulp-client repo bind produces traceback
Product: [Retired] Pulp Reporter: dgao
Component: user-experienceAssignee: Jeff Ortel <jortel>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: high    
Version: unspecifiedCC: jortel, skarmark
Target Milestone: ---   
Target Release: Sprint 21   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 12:10:54 UTC Type: ---
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: 647488    

Description dgao 2011-02-18 20:04:27 UTC
[root@champloo httpd]# pulp-client consumer bind --repoid=foo
Traceback (most recent call last):
  File "/usr/bin/pulp-client", line 5, in <module>
    pkg_resources.run_script('pulp==0.0.129', 'pulp-client')
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 467, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1200, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/EGG-INFO/scripts/pulp-client", line 63, in <module>
    client.main()
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/cli/base.py", line 137, in main
    command.main(args[1:])
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/core/base.py", line 118, in main
    action.main(args[1:])
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/core/base.py", line 224, in main
    self.run()
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/core/consumer.py", line 205, in run
    self.repolib.update()
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/repolib.py", line 70, in update
    return action.perform()
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/repolib.py", line 148, in perform
    for cont in self.getUniqueContent():
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/repolib.py", line 173, in getUniqueContent
    for r in self.getContent(product):
  File "/usr/lib/python2.7/site-packages/pulp-0.0.129-py2.7.egg/pulp/client/repolib.py", line 191, in getContent
    id = str(cont['id'])
TypeError: tuple indices must be integers, not str


Quick fix is to mod repolib.py to:

191: id = str(cont[1]['id'])
192: path = cont[1]['relative_path']

Doing so removes the traceback but produces:

[root@champloo httpd]# pulp-client consumer bind --repoid=foo
error: operation failed: Permission Denied

2011-02-18 15:02:53,446 [ERROR][MainThread] main() @ base.py:234 - error: (401, 'Permission Denied')

Comment 1 Jeff Ortel 2011-02-18 22:20:04 UTC
This was a combination of client refactoring and some REST calls begin POST instead of GET which was exposed by stricter Authentication.

Fixed: 7edeebd9359ef2bfb2327790f40725ea6ea499e8

Comment 2 Jeff Ortel 2011-02-22 14:33:34 UTC
Build: 0.140

Comment 3 dgao 2011-02-22 15:53:27 UTC
[root@pulp-qe ~]# pulp-admin repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id                 	foo                      
Name               	foo                      
FeedURL            	http://10.16.76.78/pub/updates
FeedType           	yum                      
Arch               	noarch                   
Sync Schedule      	None                     
Packages           	7                        
Files              	0                        
Distributions      	None                     
Publish            	True                     
Clones             	[]                       
Groups             	None                     

[root@pulp-qe ~]# pulp-client -u admin -p admin consumer create --id=fred
warning: this client is not registered; please register to continue
Successfully created consumer [ fred ]

[root@pulp-qe ~]# pulp-client consumer bind --repoid=foo
Successfully subscribed consumer [fred] to repo [foo]

Comment 4 Preethi Thomas 2011-08-16 12:10:54 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 5 Preethi Thomas 2011-08-16 12:22:39 UTC
Closing with Community Release 15

pulp-0.0.223-4.