Bug 999477

Summary: Needs better error handling when trying to install package/group on a consumer that does not exist on the server
Product: [Retired] Pulp Reporter: Preethi Thomas <pthomas>
Component: consumersAssignee: Jeff Ortel <jortel>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: low    
Version: 2.2 BetaCC: skarmark
Target Milestone: ---Keywords: Triaged
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-09 06:57:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Preethi Thomas 2013-08-21 11:39:35 UTC
Description of problem:

If you try to install a package or package group on a consumer that does not exist on the server, the error message is misleading


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

[root@hp-dl380pgen8-02-vm-16 ~]# rpm -qa pulp-server
pulp-server-2.2.0-0.27.beta.fc19.noarch
[root@hp-dl380pgen8-02-vm-16 ~]# 

How reproducible:


Steps to Reproduce:
1. Run package or package group install on a consumer-id that does not exist on the server


Actual results:

[root@hp-dl380pgen8-02-vm-16 ~]#  pulp-admin rpm consumer package-group install run  --consumer-id f19-consumer --name birds
This command may be exited via ctrl+c without affecting the request.

[-]
Waiting to begin...


An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.

[root@hp-dl380pgen8-02-vm-16 ~]# pulp-admin consumer list
+----------------------------------------------------------------------+
                               Consumers
+----------------------------------------------------------------------+

Id:            consumer1
Display Name:  consumer1
Description:   None
Bindings:      
  Confirmed:   rhel6-64
  Unconfirmed: 
Notes:         


Id:            f19-client
Display Name:  F19 client
Description:   F19 consumer
Bindings:      
  Confirmed:   errata, upload, pulp_unittest, zoo
  Unconfirmed: 
Notes:         
  Consumer: f19-client


[root@hp-dl380pgen8-02-vm-16 ~]# 

Expected results:


Additional info:

2013-08-21 07:39:04,504 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.7/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/consumer/content.py", line 115, in run
    self.poll([task], kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/client/commands/polling.py", line 146, in poll
    self.failed(task)
  File "/usr/lib/pulp/admin/extensions/rpm_admin_consumer/package_group.py", line 139, in failed
    details = task.result['details'][TYPE_ID_PKG_GROUP]['details']
TypeError: 'NoneType' object has no attribute '__getitem__'

Comment 1 Jeff Ortel 2014-05-09 14:52:50 UTC
Fixed by 1082245 which was included in 2.4.0-0.13.beta.

Comment 2 Preethi Thomas 2014-06-04 14:06:39 UTC
verified

[root@hp-dl380pgen8-01 ~]# rpm -qa |grep pulp-consumer
pulp-consumer-client-2.4.0-0.19.beta.fc20.noarch
[root@hp-dl380pgen8-01 ~]# 


[root@hp-dl380pgen8-01 ~]# pulp-admin rpm consumer package-group install run  --consumer-id f19-consumer --name birds
Consumer [ f19-consumer ] not found

[root@hp-dl380pgen8-01 ~]# pulp-admin consumer list
+----------------------------------------------------------------------+
                               Consumers
+----------------------------------------------------------------------+

Id:            kitkat
Display Name:  kitkat
Description:   None
Bindings:      
  Confirmed:   zoo
  Unconfirmed: 
Notes:         


[root@hp-dl380pgen8-01 ~]#

Comment 3 Randy Barlow 2014-08-09 06:57:11 UTC
This has been fixed in Pulp 2.4.0-1.