Bug 669197 - Need a cleaner error message when adding an invalid consumer to a group
Summary: Need a cleaner error message when adding an invalid consumer to a group
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: Sprint 20
Assignee: Sayli Karmarkar
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-01-12 20:58 UTC by Jay Dobies
Modified: 2015-03-23 01:10 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:11:17 UTC
Embargoed:


Attachments (Terms of Use)

Description Jay Dobies 2011-01-12 20:58:32 UTC
In the following example, test-group is a valid consumer group but foobar is not a valid consumer.

-> pulp-admin consumergroup add_consumer --consumerid foobar --id test-group
error: operation failed: Traceback (most recent call last):
  File "/home/jdob/code/pulp/src/pulp/server/webservices/controllers/base.py", line 57, in report_error
    return method(self, *args, **kwargs)
  File "/home/jdob/code/pulp/src/pulp/server/webservices/role_check.py", line 131, in check_roles
    result = f(instance, *fargs, **kw)
  File "/home/jdob/code/pulp/src/pulp/server/webservices/controllers/consumergroups.py", line 227, in POST
    return action(id)
  File "/home/jdob/code/pulp/src/pulp/server/webservices/controllers/consumergroups.py", line 169, in add_consumer
    api.add_consumer(id, data)
  File "/home/jdob/code/pulp/src/pulp/server/compat.py", line 38, in _decorator
    return decorator(*args,**kwargs)
  File "/home/jdob/code/pulp/src/pulp/server/auditing.py", line 204, in _audit
    result = method(*args, **kwargs)
  File "/home/jdob/code/pulp/src/pulp/server/api/consumer_group.py", line 103, in add_consumer
    raise PulpException("No Consumer with id: %s found" % consumerid)
PulpException: 'No Consumer with id: foobar found'

Comment 1 Sayli Karmarkar 2011-01-26 02:08:26 UTC
Fixed.

$ sudo pulp-admin consumergroup add_consumer --id=foobar --consumerid=consumer1
error: operation failed: Consumer group with id: foobar, does not exist

Comment 2 Sayli Karmarkar 2011-01-26 02:19:55 UTC
$ sudo pulp-admin consumergroup add_consumer --id=foobar --consumerid=foobar
error: operation failed: Consumer with id: foobar, does not exist

Comment 3 Jay Dobies 2011-01-26 21:27:21 UTC
Fixed in 0.132.

Comment 4 Preethi Thomas 2011-01-31 15:38:53 UTC
fails_qa

Looks like its a fail. See below.

I have consumergroup as my group, but no consumer as test

but the failure message says

error: operation failed: Consumer with id: mygroup, does not exist

instead what it should say is

error: operation failed: Consumer with id: test, does not exist

[root@preethi ~]# pulp-admin consumergroup list
+------------------------------------------+
      List of Available Consumer Groups
+------------------------------------------+

Id                      mygroup                  
Description             None                     
Consumer ids            []                       
Additional info         {}                       


[root@preethi ~]# pulp-admin consumergroup add_consumer --id=mygroup --consumerid=preethi
Successfully added consumer [preethi] to group [mygroup]

[root@preethi ~]# pulp-admin consumergroup add_consumer --id=mygroup --consumerid=test
error: operation failed: Consumer with id: mygroup, does not exist

Comment 5 Sayli Karmarkar 2011-02-04 04:27:16 UTC
Fixed and also changed error message to make it similar to one for non-existing consumer group id.

$ sudo pulp-admin consumergroup add_consumer --id=mygroup --consumerid=test
error: operation failed: Consumer [test] does not exist

Comment 6 Jay Dobies 2011-02-04 19:24:04 UTC
Fixed in 0.135.

Comment 7 Preethi Thomas 2011-02-07 20:20:47 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.135-1.fc14.noarch


[root@preethi ~]# pulp-admin consumergroup add_consumer --consumerid foobar --id mygroup
error: operation failed: Consumer [foobar] does not exist
[root@preethi ~]# pulp-admin consumergroup add_consumer --consumerid foobar --id mygroup1
error: operation failed: Consumer Group [mygroup1] does not exist

Comment 8 Preethi Thomas 2011-08-16 12:11:17 UTC
Closing with Community Release 15

pulp-0.0.223-4.

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

pulp-0.0.223-4.


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