Bug 1111224 - Wrong code status to update an event listener
Summary: Wrong code status to update an event listener
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: 2.4 Beta
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-19 13:52 UTC by Irina Gulina
Modified: 2015-02-28 22:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:10:50 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 455 0 None None None Never

Description Irina Gulina 2014-06-19 13:52:47 UTC
Description of problem:
Here https://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/event/crud.html#update-an-event-listener-configuration

According to docs we can update only:
notifier_config (object) and event_types (array) proporties of a task listener.

I tried to update other three proporties. I got a code 200 OK. However, nothing was updated except _href in each case. In /var/log/messages it returns 1 with no details.

Version-Release number of selected component (if applicable):
>> rpm -qa pulp-server
pulp-server-2.4.0-0.20.beta.el6.noarch

How reproducible:
always

Actual results:

>>curl -k -X GET https://admin:admin@localhost/pulp/api/v2/events/

[{"_href": "/pulp/api/v2/events/", "notifier_config": {"url": "http://localhost/api"}, "_ns": "event_listeners", "event_types": ["repo.sync.start"], "_id": {"$oid": "53a1ba0fb7e943519221158a"}, "id": "53a1ba0fb7
e943519221158a", "notifier_type_id": "http"}]

>>curl -i -H "Accept: application/json" -X PUT  -k https://admin:admin@localhost/pulp/api/v2/events/53a1ba0fb7e943519221158a/ --data '{"notifier_type
_id":"httpz"}'                                                                                                                                                                                                    
HTTP/1.1 200 OK
Date: Thu, 19 Jun 2014 12:06:24 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 279
Connection: close
Content-Type: application/json

{"_href": "/pulp/api/v2/events/53a1ba0fb7e943519221158a/", "notifier_config": {"url": "http://localhost/api"}, "_ns": "event_listeners", "event_types": ["repo.sync.start"], "_id": {"$oid": "53a1ba0fb7e9435192211
58a"}, "id": "53a1ba0fb7e943519221158a", "notifier_type_id": "http"}

>>curl -i -H "Accept: application/json" -X PUT  -k https://admin:admin@localhost/pulp/api/v2/events/53a1ba0fb7e943519221158a/ --data '{"_href": "/pulp/api/v2/"}'                                                                                                                                                                                                       
HTTP/1.1 200 OK
Date: Thu, 19 Jun 2014 12:07:15 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 279
Connection: close
Content-Type: application/json

{"_href": "/pulp/api/v2/events/53a1ba0fb7e943519221158a/", "notifier_config": {"url": "http://localhost/api"}, "_ns": "event_listeners", "event_types": ["repo.sync.start"], "_id": {"$oid": "53a1ba0fb7e9435192211
58a"}, "id": "53a1ba0fb7e943519221158a", "notifier_type_id": "http"}

>>curl -i -H "Accept: application/json" -X PUT  -k https://admin:admin@localhost/pulp/api/v2/events/53a1ba0fb7e943519221158a/ --data '{"_ns": "chebur
ashka"}'                                                                                                                                                                                                           
HTTP/1.1 200 OK
Date: Thu, 19 Jun 2014 12:07:59 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 279
Connection: close
Content-Type: application/json

{"_href": "/pulp/api/v2/events/53a1ba0fb7e943519221158a/", "notifier_config": {"url": "http://localhost/api"}, "_ns": "event_listeners", "event_types": ["repo.sync.start"], "_id": {"$oid": "53a1ba0fb7e9435192211
58a"}, "id": "53a1ba0fb7e943519221158a", "notifier_type_id": "http"}

>> less /var/log/messages
init: ttyS0 (/dev/ttyS0) main process (20712) terminated with status 1
init: ttyS0 (/dev/ttyS0) main process ended, respawning
init: ttyS0 (/dev/ttyS0) main process (20713) terminated with status 1
init: ttyS0 (/dev/ttyS0) main process ended, respawning


Expected results:

HTTP/1.1 400 Bad Request
...
and with
>>less /var/log/messages

Invalid properties: ['property_name']

Comment 1 Jeremy Cline 2014-08-07 17:34:43 UTC
I've untriaged this after a discussion with Barnaby. We aren't consistent with how we deal with extra keys. For example, see https://bugzilla.redhat.com/show_bug.cgi?id=1127861

If we decide we should succeed if extra keys are given, this isn't a bug. If we decide we should fail when extra keys are given, this is a bug, and we've got a lot of other bugs.

Comment 2 Brian Bouterse 2015-02-28 22:10:50 UTC
Moved to https://pulp.plan.io/issues/455


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