Project

Profile

Help

Issue #1622

Pulp event notifier not setting the right content type

Added by paji@redhat.com over 4 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
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.

Associated revisions

Revision ccd0a77f View on GitHub
Added by Jeremy Cline over 4 years ago

Ensure the HTTP event notifier sends JSON-encoded bodies.

By default requests form-encodes post requests. However, there is a json kwarg that will dump the provided dictionary to JSON and POST it with the correct content type.

History

#1 Updated by jcline@redhat.com over 4 years ago

  • Status changed from NEW to POST
  • Assignee set to jcline@redhat.com
  • Triaged changed from No to Yes

#2 Updated by jcline@redhat.com over 4 years ago

  • Status changed from POST to MODIFIED

#3 Updated by rbarlow over 4 years ago

  • Platform Release set to 2.8.0

#4 Updated by dkliban@redhat.com over 4 years ago

  • Status changed from MODIFIED to 5

#5 Updated by dkliban@redhat.com over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#6 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF