UnboundLocalError: local variables referenced before assignment in integration tests

Bug #1428064 reported by Anastasia Kuznetsova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Low
Anastasia Kuznetsova

Bug Description

During integration tests if stack or one of resources wasn't created before timeout expiration, then appropriate exception has to be raised:

message = ('Resource %s failed to reach %s status within '
                   'the required time (%s s).' %
                   (res.resource_name, status, build_timeout))
or

message = ('Stack %s failed to reach %s status within '
                   'the required time (%s s).' %
                   (stack.stack_name, status, build_timeout))

in /heat_integrationtests/common/test.py

Problem is that "res" and "stack" are local variables and can't be used outside 'while' loop.

Changed in heat:
assignee: nobody → Anastasia Kuznetsova (akuznetsova)
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
milestone: none → kilo-3
importance: Medium → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/161159
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=e95e8ca22eafa9b44f4702614d5591bb4d8b58e9
Submitter: Jenkins
Branch: master

commit e95e8ca22eafa9b44f4702614d5591bb4d8b58e9
Author: Anastasia Kuznetsova <email address hidden>
Date: Wed Mar 4 13:19:15 2015 +0400

    Fix variables reference in the integration tests methods

    In the common integration tests methods: _wait_for_stack_status and
    _wait_for_resource_status local variables 'res' and 'stack' were used
    outside the loop where they were referenced.

    Change-Id: I4b68054a9474dbfe36955602e7961e9328bb278e
    Closes-Bug: #1428064

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-3 → 2015.1.0
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.