server_external_events response status is always 'completed' instead of event status which requested as failed

Bug #1856311 reported by Punith Kenchappa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Unassigned

Bug Description

Description
===========
For the server external event rest api response is always completed instead of what the user requested to updated as failed/in-progress .

here the changes required :
https://github.com/openstack/nova/blob/aa096fd18352fb9da94069ec2cab478eed5c6cca/nova/api/openstack/compute/server_external_events.py#L133

Steps to reproduce
==================
1. POST a rest api request with the status as failed .
2. API response event status will be always completed .

Expected result
===============
Post request :
openstack/compute/v2.1/os-server-external-events
{
 "events": [
   {
     "name": "network-vif-plugged",
     "tag": "foo",
     "server_uuid": "b20f436b-b9b6-4a8d-a1f7-411ed42ffe62",
     "status": "failed"
   }
  ]
}

Response :

{
    "events": [
        {
            "status": "failed",
            "tag": "foo",
            "name": "network-vif-plugged",
            "server_uuid": "b20f436b-b9b6-4a8d-a1f7-411ed42ffe62",
            "code": 200
        }
    ]
}

Actual result
=============

Post request :
openstack/compute/v2.1/os-server-external-events
{
 "events": [
   {
     "name": "network-vif-plugged",
     "tag": "foo",
     "server_uuid": "b20f436b-b9b6-4a8d-a1f7-411ed42ffe62",
     "status": "failed"
   }
  ]
}

Response :

{
    "events": [
        {
            "status": "completed",
            "tag": "foo",
            "name": "network-vif-plugged",
            "server_uuid": "b20f436b-b9b6-4a8d-a1f7-411ed42ffe62",
            "code": 200
        }
    ]
}

Revision history for this message
Matt Riedemann (mriedem) wrote :

What release is this against? Have you seen this recent change?

https://github.com/openstack/nova/commit/e6f742544432d6066f1fba4666580919eb7859bd

Also if you're saying that you think because the client posted a 'failed' event but the response contains a 200 for that event, that is working as designed:

https://docs.openstack.org/api-ref/compute/?expanded=run-events-detail#run-events

Because the 200 means the event in the request has been processed.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Hmm this should pull the status from the request and put it on the response:

https://github.com/openstack/nova/blob/e6f742544432d6066f1fba4666580919eb7859bd/nova/api/openstack/compute/server_external_events.py#L96

and then changed to completed here because the instance.host is set so we're going to process the event:

https://github.com/openstack/nova/blob/e6f742544432d6066f1fba4666580919eb7859bd/nova/api/openstack/compute/server_external_events.py#L133

I think this is working as designed.

Changed in nova:
status: New → Opinion
Matt Riedemann (mriedem)
Changed in nova:
status: Opinion → Won't Fix
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.