Incorrect payload in notification results in running status forever

Bug #1808513 reported by jayashri bidwe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
masakari
Fix Released
Undecided
jayashri bidwe

Bug Description

Bug Description:
================
Create a notification using empty payload.

curl -g -i -X POST http://<IP>/instance-ha/v1/<Project_ID>/notifications -H "Content-Type: application/json" -H "User-Agent: masakari keystoneauth1/3.11.1 python-requests/2.20.0 CPython/2.7.12" -H "X-Auth-Token: <AUTH _TOKEN>" -d '{"notification": {"hostname": "ABC", "type": "PROCESS", "payload": {}, "generated_time": "2018-12-06 16:47:55"}}'

It creates a notification successfully but notification status goes into running state forever.

Actual Result:
===============
It creates a notification successfully.

Expected Result:
===============
It should fail if payload is empty or not as per the API ref document [1]

[1]: https://developer.openstack.org/api-ref/instance-ha/?expanded=create-notification-detail

Changed in masakari:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to masakari (master)

Fix proposed to branch: master
Review: https://review.openstack.org/626541

Changed in masakari:
assignee: nobody → jayashri bidwe (jayashrib)
status: Confirmed → In Progress
Changed in masakari:
assignee: jayashri bidwe (jayashrib) → Shilpa Devharakar (shilpasd)
Changed in masakari:
assignee: Shilpa Devharakar (shilpasd) → jayashri bidwe (jayashrib)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to masakari (master)

Reviewed: https://review.openstack.org/626541
Committed: https://git.openstack.org/cgit/openstack/masakari/commit/?id=70ecfe946e679c432676a09ed31daeaffca73359
Submitter: Zuul
Branch: master

commit 70ecfe946e679c432676a09ed31daeaffca73359
Author: jayashri bidwe <email address hidden>
Date: Mon Dec 10 11:57:08 2018 +0530

    Return 400 if notification payload is incorrect

    This patch validates the notification payload at schema level as per
    API ref document[1]. Raises BadRequest(400) if payload is incorrect
    based on notification type.

    APIImpact
    BadRequest(400) is returned if payload is incorrect instead of 202
    during notification create.

    Closes-Bug: #1808513

    [1]: https://developer.openstack.org/api-ref/instance-ha/

    Change-Id: Iccad15a955be1b11f31d829624d43b6ea915305c

Changed in masakari:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/masakari 7.0.0.0rc1

This issue was fixed in the openstack/masakari 7.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.