Project

Profile

Help

Issue #1622

closed

Pulp event notifier not setting the right content type

Added by paji@redhat.com about 8 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

1) Create a post sync notifier in pulp. There may be a pulp-admin way of doing this -> but Katello does it in the following way

path = /pulp/api/v2/events/, args = post,{"notifier_type_id":"http","notifier_config":{"url":"https://<SAT FQDN>/katello/api/v2/repositories/sync_complete?token=test"},"event_types":["repo.sync.finish"]},{"content_type"=>"application/json", "accept"=>"application/json", "Authorization"=>"OAuth oauth_body_hash=\"2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D\", oauth_consumer_key=\"5N52BJQuADMGfHKMhzRV8NUfKUZvePw4\", oauth_nonce=\"b5L7Mkm0QXEi4WiM2j3Sdqz4CCPsdxnYClgBJ2dxyko\", oauth_signature=\"s%2BhM%2FjS%2FBMaFuu%2FpS%2FezpubMdcs%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1454430929\", oauth_version=\"1.0\"", "pulp-user"=>"admin"}

2) Sync any repo

Katello logs noticed the following error

2016-02-02T11:05:03 [app] [D] With body: {                                                                           
 |   "error": {"message":"'Content-Type: application/x-www-form-urlencoded' is unsupported in API v2 for POST and PUT
requests. Please use 'Content-Type: application/json'."}                                                             
 | }                                                                                                                 

So the sync complete notifier didnt set the content type correctly.

Also available in: Atom PDF