kolla-docker module can crash with undefined variable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kolla-ansible |
Fix Released
|
Medium
|
Victor Coutellier | ||
Queens |
Fix Committed
|
Medium
|
Mark Goddard | ||
Rocky |
Fix Committed
|
Medium
|
Mark Goddard | ||
Stein |
Fix Released
|
Medium
|
Victor Coutellier |
Bug Description
It is possible to reference undefined variable in kolla-docker module due to this commit : https:/
ansible/
def main():
module = generate_module()
try:
dw = DockerWorker(
result = bool(getattr(dw, module.
except Exception:
If DockerWorker object initialization fail (mainly if installed docker-py package is broken and we can't init docker client), so we can't reference to dw.result in the except block, and ansible will really crash with a unwanted error message :
UnboundLocalError: local variable 'dw' referenced before assignment
Reviewed: https:/ /review. openstack. org/642286 /git.openstack. org/cgit/ openstack/ kolla-ansible/ commit/ ?id=3bb4c199817 c8aa4ecd4ae684b d28f84933fb14d
Committed: https:/
Submitter: Zuul
Branch: master
commit 3bb4c199817c8aa 4ecd4ae684bd28f 84933fb14d
Author: Victor Coutellier <email address hidden>
Date: Sun Mar 10 19:07:00 2019 +0100
Fix kolla-docker possible undefined variable
It is possible to reference undefined variable in kolla-docker module if
DockerWorker object initialization fail, so the current behaviour will
crash the playbook with the unwanted error message :
UnboundLoca lError: local variable 'dw' referenced before assignment
Change-Id: Ic8d26b11f93255 220888b5406f8ab 4a6f81736c2
Closes-Bug: #1819361