Ironic driver: _cleanup_deploy is called with incorrect parameters

Bug #1581246 reported by sergiiF
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
Mitaka
New
Undecided
Unassigned

Bug Description

stable/mitaka release.
If error happens in _generate_configdrive Ironic driver fails cleanup because of

2016-05-12 22:44:55.295 9282 ERROR nova.compute.manager [instance: 7f8769b3-145a-4b81-8175-e6aa648e1c2a] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2218, in _build_resources
2016-05-12 22:44:55.295 9282 ERROR nova.compute.manager [instance: 7f8769b3-145a-4b81-8175-e6aa648e1c2a] yield resources
2016-05-12 22:44:55.295 9282 ERROR nova.compute.manager [instance: 7f8769b3-145a-4b81-8175-e6aa648e1c2a] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2064, in _build_and_run_instance
2016-05-12 22:44:55.295 9282 ERROR nova.compute.manager [instance: 7f8769b3-145a-4b81-8175-e6aa648e1c2a] block_device_info=block_device_info)
2016-05-12 22:44:55.295 9282 ERROR nova.compute.manager [instance: 7f8769b3-145a-4b81-8175-e6aa648e1c2a] File "/usr/lib/python2.7/site-packages/nova/virt/ironic/driver.py", line 748, in spawn
2016-05-12 22:44:55.295 9282 ERROR nova.compute.manager [instance: 7f8769b3-145a-4b81-8175-e6aa648e1c2a] flavor=flavor)
2016-05-12 22:44:55.295 9282 ERROR nova.compute.manager [instance: 7f8769b3-145a-4b81-8175-e6aa648e1c2a] TypeError: _cleanup_deploy() takes exactly 4 arguments (6 given)

Call
https://github.com/openstack/nova/blob/stable/mitaka/nova/virt/ironic/driver.py#L747
Function definition
https://github.com/openstack/nova/blob/stable/mitaka/nova/virt/ironic/driver.py#L374

Tags: ironic
sergiiF (framin)
description: updated
Revision history for this message
Matt Riedemann (mriedem) wrote :

Yeah it doesn't raise that up because it's in a excutils.save_and_reraise_exception context.

tags: added: ironic
Changed in nova:
status: New → Triaged
assignee: nobody → Matt Riedemann (mriedem)
importance: Undecided → Medium
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/316336

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

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

commit d2875b78b5746bfcb082a7c5385375d704518581
Author: Matt Riedemann <email address hidden>
Date: Fri May 13 22:28:24 2016 -0400

    ironic: fix call to _cleanup_deploy on config drive failure

    The call to _cleanup_deploy when config drive generation failed
    during spawn didn't match the method signature. This was missed
    in unit testing because the assertion on the mock of that method
    matched the actual call, but not the actual method signature.

    This fixes the call and also fixes the test by auto-spec'ing the
    _cleanup_deploy method in the mock so that it validates the actual
    function signature is called correctly.

    In order to use autospec properly here, the mock has to be on the
    driver object rather than the class.

    Change-Id: Ic2c096ef846f11f94aa828222c927ed7d03051c9
    Closes-Bug: #1581246

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/nova 14.0.0.0b1

This issue was fixed in the openstack/nova 14.0.0.0b1 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.