[system-tests] Mutable default arguments
Bug #1512671 reported by
Aleksei Stepanov
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Released
|
Medium
|
Aleksei Stepanov |
Bug Description
Master branch: fuelweb_test & system_test
Default argument is mutable -> 8 times counted. It's as minimum bad practice and security issue for production (not test) use (possible to modify values from external side during execution).
Fix way:
1. set default value to None or use specific custom type for it
2. process default value in if tree at start of function
Permanent monitor:
At PyLint: warning W0102 should be monitored strictly
Changed in fuel: | |
assignee: | nobody → Alexey Stepanov (astepanov-m) |
importance: | Undecided → Medium |
status: | New → In Progress |
milestone: | none → 8.0 |
summary: |
- Tests: Python: mutable default arguments + [system-tests] Mutable default arguments |
tags: | added: area-qa |
Changed in fuel: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/241241 /git.openstack. org/cgit/ openstack/ fuel-qa/ commit/ ?id=b63dd9848bd 5e6ade8c0bc740f 10614be9237b45
Committed: https:/
Submitter: Jenkins
Branch: master
commit b63dd9848bd5e6a de8c0bc740f1061 4be9237b45
Author: Alexey Stepanov <email address hidden>
Date: Tue Nov 3 17:58:58 2015 +0300
Refactor & fix incorrect default args
Fix:
1. Default arguments should not be mutable
2. Set could be created without set() call (little faster)
3. Redundant parenthesis (readability)
4. lambdas is strictly not recommended by PEP8, especially as class variables
5. fix old style classes (not inherited from object)
Update-reason: rebase
Closes-Bug: #1512671
Change-Id: Id8314b76848278 b67da898600240b 59cf76a7328