]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Use immutable default values for args
authorIvan Kolodyazhny <e0ne@e0ne.info>
Mon, 14 Jul 2014 21:13:54 +0000 (00:13 +0300)
committerIvan Kolodyazhny <e0ne@e0ne.info>
Wed, 16 Jul 2014 06:42:08 +0000 (09:42 +0300)
commit1cfb7da7ce3f93765ba2e267897b5b7825a0ba75
tree8b9456e0cc5f69f7abf56161c62175b898b5f3ac
parentcfe8f2dec11dbd335028a3ba9c793f5901ef4fcf
Use immutable default values for args

Default mutable values (e.g. arg1=[], arg2={}) could have side effects
in Python. So using None as a default value is safer.

Added hacking checks for default mutable args.

Closes: bug #1327473
Change-Id: I7055e534b91df794550de6c3b243324e582d4430
14 files changed:
cinder/api/xmlutil.py
cinder/hacking/checks.py
cinder/scheduler/driver.py
cinder/scheduler/filter_scheduler.py
cinder/tests/api/v2/stubs.py
cinder/tests/brick/test_brick_connector.py
cinder/tests/test_coraid.py
cinder/tests/test_vmware_vmdk.py
cinder/tests/test_volume_utils.py
cinder/transfer/api.py
cinder/volume/drivers/netapp/utils.py
cinder/volume/drivers/vmware/vmdk.py
cinder/volume/qos_specs.py
cinder/volume/volume_types.py