[fuel-qa] Incorrect repos list processing which leads to unpredictiable results
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Released
|
High
|
Sergey Kulanov | ||
8.0.x |
Invalid
|
Critical
|
Unassigned |
Bug Description
We have incorrect logic (in replace_repos [1] module). While working with repos we modify list in `for` loop which is wrong:
for repo in repos:
if repo['name'] in ('mos-updates', 'mos-security'):
Steps to reproduce:
run any test, smoke for example with:
PATCHING_
MIRROR_
not all repos will be removed, please see some of my tests, as you can see mos-security was not removed:
1)
2016-03-25 22:12:04,715 - DEBUG __init__.py:61 -- Done: add_ubuntu_mirrors with result: [{'name': 'ubuntu-0', 'section': 'main universe multiverse', 'uri': 'http://
2)
2016-03-25 22:12:04,715 - INFO replace_repos.py:33 -- repos_attr: 'ubuntu http://
2016-03-25 22:12:04,715 - DEBUG replace_repos.py:39 -- Removing mirror: 'ubuntu http://
2016-03-25 22:12:04,715 - INFO replace_repos.py:33 -- repos_attr: 'ubuntu-updates http://
2016-03-25 22:12:04,715 - DEBUG replace_repos.py:39 -- Removing mirror: 'ubuntu-updates http://
2016-03-25 22:12:04,715 - INFO replace_repos.py:33 -- repos_attr: 'ubuntu-security http://
2016-03-25 22:12:04,716 - DEBUG replace_repos.py:39 -- Removing mirror: 'ubuntu-security http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:33 -- repos_attr: 'mos http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:33 -- repos_attr: 'mos-updates http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:33 -- repos_attr: 'mos-security http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:33 -- repos_attr: 'mos-holdback http://
3) Replacing:
2016-03-25 22:12:04,716 - INFO replace_repos.py:48 -- Repo: 'ubuntu-0 http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:48 -- Repo: 'ubuntu-1 http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:48 -- Repo: 'ubuntu-2 http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:48 -- Repo: 'ubuntu-3 http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:48 -- Repo: 'mos http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:48 -- Repo: 'mos-updates http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:51 -- Removing MOS mirror: 'mos-updates http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:48 -- Repo: 'mos-holdback http://
2016-03-25 22:12:04,716 - INFO replace_repos.py:51 -- Removing MOS mirror: 'mos-holdback http://
4) result:
2016-03-25 22:12:04,717 - DEBUG __init__.py:61 -- Done: replace_
Expected results:
All repos should be removed mos-updates and mos-security
How to fix:
If you need to modify the sequence you are iterating over while inside the loop (for example to duplicate selected items), it is recommended that you first make a copy. Iterating over a sequence does not implicitly make a copy.
Set to High since can lead to unpredictable results in repo-lists
[1]. https:/
Changed in fuel: | |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/298042
Review: https:/