Bug 860425 - Consumer - inconsitency in attribute name 'display_name' vs 'display-name'
Consumer - inconsitency in attribute name 'display_name' vs 'display-name'
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: API/integration (Show other bugs)
Master
Unspecified Unspecified
unspecified Severity low
: ---
: Sprint 40
Assigned To: Jeff Ortel
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-25 15:26 EDT by Brad Buckingham
Modified: 2013-09-09 11:44 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-09 12:05:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brad Buckingham 2012-09-25 15:26:44 EDT
Description of problem:

We have a small inconsistency in the api for consumers with respect to the 'display_name' attribute.  In most cases, we use 'display_name' (e.g. Register a Consumer request, Retrieve a Single Consumer response, Retrieve All Consumers response..etc); however, the 'Update a Consumer' request requires it to be specified as 'display-name'.

Version-Release number of selected component (if applicable):
pulp-server-2.0.5-1.fc16.noarch

How reproducible:
always

Steps to Reproduce:
1. create a consumer
2. attempt to update the consumer's display_name

a.
curl -k -u admin:admin -X PUT "https://localhost/pulp/api/v2/consumers/f9b8d2c5-7427-4f37-a44f-b46ff5151fd7/" -d '{"delta":{"display_name":"updated display name"}}'

b.
curl -k -u admin:admin -X PUT "https://localhost/pulp/api/v2/consumers/f9b8d2c5-7427-4f37-a44f-b46ff5151fd7/" -d '{"delta":{"display-name":"updated display name"}}'

  
Actual results:
2.a does not change the display name for the consumer

2.b does change the display name for the consumer (however, everywhere else seems to use 'display_name')

Expected results:
2.a changes the display name for the consumer

Additional info:
Comment 1 Jeff Ortel 2012-10-04 20:11:18 EDT
Corrected consumer update.

https://github.com/pulp/pulp/pull/100
Comment 2 Jeff Ortel 2012-10-05 17:43:12 EDT
build: 0.331
Comment 3 Preethi Thomas 2012-10-10 09:49:43 EDT
[root@pulp-master ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.331-1.fc17.noarch
[root@pulp-master ~]# 

[root@pulp-master ~]# pulp-admin -u admin -p admin consumer list
+----------------------------------------------------------------------+
                               Consumers
+----------------------------------------------------------------------+

Id:            pulp-master
Display Name:  updated display name
Description:   None
Notes:         


[root@pulp-master ~]# curl -k -u admin:admin -X PUT "https://localhost/pulp/api/v2/consumers/pulp-master/" -d '{"delta":{"display-name":"updated display name1"}}'
{"display_name": "updated display name", "description": null, "certificate": "-----BEGIN CERTIFICATE-----\nMIICGjCCAQICAQEwDQYJKoZIhvcNAQEFBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0\nMB4XDTEyMTAxMDEzNDA0MloXDTIyMTAwODEzNDA0MlowFjEUMBIGA1UEAxMLcHVs\ncC1tYXN0ZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALlsscdz72KIDihG\nNCJea+Y5XoLGhRPu2jQAFbvGRyzmA3bHS2cy+5eI1Rz1CA25hXlIHJd70cqAXY8P\nKHYO6J/0qMzFmhomud+l3KBN4Sb6elG0bFqzKSTr/GEhZc32BV3DvKLmVKL7qtYN\n0aEUhuphjHlw6vZ5yxZRWDlCo5LPAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAHdU\nakJaAB8kCrNJkxoqDapBQNx077Z81Qg9I+7e3PWWOjD+Bw4fXMm8dfx9qBvuTbsN\nxGMsyzx12AZFuvsr1OfotxpIRedYiYM4JIdxrEw7a3/5c8T/vYgWHp2ZVVG/TKTO\nSLvl9I9RuAiWmuYaJYJg9s2Q8s7MBsq+UTEAKHH8RNs41shHbIOUEp9ta21diMAP\ndrC8oaluRJIF6L3tC62edsihvJK+05UMMYcRQcWET1Yo2kZqFlVUKQppiEDG9XCV\nD8uGAe0iv11FKdLf91SVzALSUCCt4lrQP6pjJUm5Zwwj3SGp9486QOQzb0jBUh4I\nABtCLRWoX8ufV0EJLiA=\n-----END CERTIFICATE-----", "_ns": "consumers", "notes": {}, "capabilities": {}, "unit_profile": [], "_id": {"$oid": "50757adaedfc065dee000125"}, "id": "pulp-master", "_href": "/pulp/api/v2/consumers/pulp-ma
[root@pulp-master ~]# 
[root@pulp-master ~]# 
[root@pulp-master ~]# 
[root@pulp-master ~]# pulp-admin -u admin -p admin consumer list+----------------------------------------------------------------------+
                               Consumers
+----------------------------------------------------------------------+

Id:            pulp-master
Display Name:  updated display name
Description:   None
Notes:         

[root@pulp-master ~]# curl -k -u admin:admin -X PUT "https://localhost/pulp/api/v2/consumers/pulp-master/" -d '{"delta":{"display_name":"updated display_name1"}}'
{"display_name": "updated display_name1", "description": null, "certificate": "-----BEGIN CERTIFICATE-----\nMIICGjCCAQICAQEwDQYJKoZIhvcNAQEFBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0\nMB4XDTEyMTAxMDEzNDA0MloXDTIyMTAwODEzNDA0MlowFjEUMBIGA1UEAxMLcHVs\ncC1tYXN0ZXIwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALlsscdz72KIDihG\nNCJea+Y5XoLGhRPu2jQAFbvGRyzmA3bHS2cy+5eI1Rz1CA25hXlIHJd70cqAXY8P\nKHYO6J/0qMzFmhomud+l3KBN4Sb6elG0bFqzKSTr/GEhZc32BV3DvKLmVKL7qtYN\n0aEUhuphjHlw6vZ5yxZRWDlCo5LPAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAHdU\nakJaAB8kCrNJkxoqDapBQNx077Z81Qg9I+7e3PWWOjD+Bw4fXMm8dfx9qBvuTbsN\nxGMsyzx12AZFuvsr1OfotxpIRedYiYM4JIdxrEw7a3/5c8T/vYgWHp2ZVVG/TKTO\nSLvl9I9RuAiWmuYaJYJg9s2Q8s7MBsq+UTEAKHH8RNs41shHbIOUEp9ta21diMAP\ndrC8oaluRJIF6L3tC62edsihvJK+05UMMYcRQcWET1Yo2kZqFlVUKQppiEDG9XCV\nD8uGAe0iv11FKdLf91SVzALSUCCt4lrQP6pjJUm5Zwwj3SGp9486QOQzb0jBUh4I\nABtCLRWoX8ufV0EJLiA=\n-----END CERTIFICATE-----", "_ns": "consumers", "notes": {}, "capabilities": {}, "unit_profile": [], "_id": {"$oid": "50757adaedfc065dee000125"}, "id": "pulp-master", "_href": "/pulp/api/v2/consumers/pulp-master/"}[root@pulp-master ~]# 
[root@pulp-master ~]# 
[root@pulp-master ~]# pulp-admin -u admin -p admin consumer list+----------------------------------------------------------------------+
                               Consumers
+----------------------------------------------------------------------+

Id:            pulp-master
Display Name:  updated display_name1
Description:   None
Notes:         


[root@pulp-master ~]#
Comment 4 Preethi Thomas 2013-01-09 12:05:11 EST
Pulp v2.0 released

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