Ensure default arguments are not mutable

* add hacking check: no_mutable_default_args()
* remove the mutable default arguments "[]" or "{}" when the function
  is defined.

ref: http://docs.python-guide.org/en/latest/writing/gotchas/

Closes-Bug: #1530282
Change-Id: Ice6f7654211b73d7f8bc3ca0e4dfae3dca354397
This commit is contained in:
Javeme 2015-12-29 20:37:16 +08:00
parent a1c1c84e5d
commit 545a3af243
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ class VanillaProvider(p.ProvisioningPluginBase):
return self._get_version_handler(
cluster.hadoop_version).get_edp_engine(cluster, job_type)
def get_edp_job_types(self, versions=[]):
def get_edp_job_types(self, versions=None):
res = {}
for vers in self.version_factory.get_versions():
if not versions or vers in versions: