Bug 669210

Summary: Need a cleaner error message when failing to add a key-value pair to a consumer
Product: [Retired] Pulp Reporter: Jay Dobies <jason.dobies>
Component: z_otherAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: cperry, jconnor, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: ---   
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:11:21 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 Jay Dobies 2011-01-12 21:31:39 UTC
$ pulp-admin consumer add_keyvalue --id foo --key jdob --value zombie
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/controllers/consumers.py", line 504, in POST
    return action(id)
  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/consumers.py", line 313, in add_key_value_pair
    consumer_api.add_key_value_pair(id, data['key'], data['value'])
  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.py", line 159, in add_key_value_pair
    'from that group and try again.', key, conflicting_group)
PulpException: u'Given key [jdob] has different value for this consumer because of its membership in group [bar]. You can delete consumer from that group and try again.'

Comment 1 Sayli Karmarkar 2011-03-14 22:53:02 UTC
This seems to be fixed because of jconnor and jmatthews's fixes for server side traceback.  

$ sudo pulp-admin consumer add_keyvalue --id=consumer1 --key=key1 --value=foo

error: operation failed: PulpException: u'Given key [key1] has different value for this consumer because of its membership in group [consumergroup1]. You can delete consumer from that group and try again.'

Comment 2 Preethi Thomas 2011-03-28 14:50:31 UTC
verified


[root@preethi ~]# rpm -q pulp
pulp-0.0.157-1.git.1.1ea502c.fc14.noarch
[root@preethi ~]# pulp-admin consumer add_keyvalue  --id preethi.usersys.redhat.com --key preethi --value consumer-value
error: operation failed: PulpException: u'Given key [preethi] has different value for this consumer because of its membership in group [test-group]. You can delete consumer from that group and try again.'

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

pulp-0.0.223-4.

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

pulp-0.0.223-4.