[EC2] Terminateinstance returns incorrect current state name

Bug #1322025 reported by Swami Reddy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Swami Reddy

Bug Description

TerminateInstance returns the currentstate name and previousstate name are same.
In the below sample response elements show the currnentstate name and previoustate name as "running".
Ideally the currentstate name should be "terminated".
==
<TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">
  <requestId>req-c15f5c7d-2551-4a08-b8b8-255462a09592</requestId>
  <instancesSet>
    <item>
      <instanceId>i-00000001</instanceId>
      <currentState>
        <code>16</code>
        <name>running</name>
      </currentState>
      <previousState>
        <code>16</code>
        <name>running</name>
      </previousState>
    </item>
  </instancesSet>
</TerminateInstancesResponse>
==

Tags: ec2
Swami Reddy (swamireddy)
Changed in nova:
assignee: nobody → Swami Reddy (swamireddy)
status: New → In Progress
Revision history for this message
Tracy Jones (tjones-i) wrote :

Swami - if you are working on this, please update. Otherwise you should remove your name

Revision history for this message
Swami Reddy (swamireddy) wrote :

 Will submit the patch soon.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/104860
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e15ce7735e492f9eb0914efb621211e315ea40d9
Submitter: Jenkins
Branch: master

commit e15ce7735e492f9eb0914efb621211e315ea40d9
Author: Swami Reddy <email address hidden>
Date: Wed Aug 27 14:03:05 2014 +0530

    Fix the current state name as 'shutting-down'

    Currently, the TerminateInstance returns the currentstate name
    as previous state name. Ideally the TerminateInstance return
    element's currentstate named as "shutting-down".

    Addressed the issue and below is the terminateinstance response with fix:
    ==
    <TerminateInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2013-10-15/">
      <requestId>req-c15f5c7d-2551-4a08-b8b8-255462a09592</requestId>
      <instancesSet>
        <item>
          <instanceId>i-00000001</instanceId>
          <currentState>
            <code>32</code>
            <name>shutting-down</name>
          </currentState>
          <previousState>
            <code>16</code>
            <name>running</name>
          </previousState>
        </item>
      </instancesSet>
    </TerminateInstancesResponse>
    ==

    And also updated the testcases in nova/tests/api/ec2/test_cloud.py
    appropriately.

    Closes-bug: #1322025

    Change-Id: I790e7d86ef8fd9f4fc1612bae2788e0ae7ef9719

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.2
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.