deployment variable leaked outside of loop scope

Bug #1866637 reported by Kevin Carter
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Kevin Carter

Bug Description

when running a deployment it is possible for a the deployment to fail due to the "payload" object not being defined. This is caused by a leaked variable being used outside of the loop scope. While this works today due to the assumption of an executed workflow, if there were no workflows called the variable would be undefined resulting in the following stacktrace:

Captured traceback:
    Traceback (most recent call last):
      File "/home/kecarter/projects/python-tripleoclient/.tox/py37/lib/python3.7/site-packages/mock/", line 1330, in patched
        return func(*args, **keywargs)
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/tests/v1/overcloud_deploy/", line 630, in test_tht_deploy_skip_deploy_identifier
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/v1/", line 943, in take_action
        self._deploy_tripleo_heat_templates_tmpdir(stack, parsed_args)
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/v1/", line 363, in _deploy_tripleo_heat_templates_tmpdir
        new_tht_root, tht_root)
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/v1/", line 465, in _deploy_tripleo_heat_templates
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/v1/", line 484, in _try_overcloud_deploy_with_compat_yaml
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/v1/", line 237, in _heat_deploy
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/workflows/", line 85, in deploy_and_wait
        deploy(log, clients, **workflow_input)
      File "/home/kecarter/projects/python-tripleoclient/tripleoclient/workflows/", line 63, in deploy
        if payload['status'] != "SUCCESS":
    UnboundLocalError: local variable 'payload' referenced before assignment

To correct this issue the leaked variable should be moved inside the loop.

Changed in tripleo:
assignee: nobody → Kevin Carter (kevin-carter)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Submitter: Zuul
Branch: master

commit ad9c7a7504edd3da36365e267ef38c037241d6f9
Author: Kevin Carter <email address hidden>
Date: Mon Feb 24 12:28:58 2020 -0600

    Remove mistral when running the register_or_update workflow

    This change removes all of mistral from the register_or_update workflow
    by calling the required functions directly.

    Story: 2007212
    Task: 38442

    Closes-Bug: #1866637
    Change-Id: Ie85adc64cd4fcec469d6979a424d8f01b00f34f2
    Signed-off-by: Kevin Carter <email address hidden>

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 13.2.0

This issue was fixed in the openstack/python-tripleoclient 13.2.0 release.

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.