avoid one unnecessary _get_power_state call

Bug #1589960 reported by jichenjc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
jichenjc

Bug Description

https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L877

has _get_power_state in its function in
https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1042

then we call it again

https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L878

actually there is no state change in _retry_reboot function
so we can reuse the state as variable and avoid mock in test

Tags: compute
jichenjc (jichenjc)
Changed in nova:
assignee: nobody → jichenjc (jichenjc)
tags: added: compute
Changed in nova:
importance: Undecided → Low
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/326431

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 6211543493418509d5d1ace1a1ef55a3eebcd6b2
Author: jichenjc <email address hidden>
Date: Mon May 2 10:59:40 2016 +0800

    Avoid unnessary _get_power_state call

    the result of _get_power_state can be reused and no need to
    call it twice which don't have any state change.

    Change-Id: I3c495031d98b35734f37139ac1b1c3a4d25d0a8f
    Closes-Bug: 1589960

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 14.0.0.0b2

This issue was fixed in the openstack/nova 14.0.0.0b2 development milestone.

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.