1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-23 00:23:53 +03:00

python: fix mutable default arguments

Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 23 23:33:46 UTC 2023 on atb-devel-224
This commit is contained in:
Rob van der Linde
2023-02-23 15:54:37 +13:00
committed by Andrew Bartlett
parent e7c87b1d9b
commit 5cb8805811
26 changed files with 243 additions and 66 deletions

View File

@@ -475,7 +475,7 @@ class gp_applier(object):
'''
pass
def clean(self, guid, keep=[], remove=[], **kwargs):
def clean(self, guid, keep=None, remove=None, **kwargs):
'''Cleanup old removed attributes
keep - A list of attributes to keep
remove - A single attribute to remove, or a list of attributes to
@@ -487,6 +487,11 @@ class gp_applier(object):
'''
# Clean syntax is, either provide a single remove attribute,
# or a list of either removal attributes or keep attributes.
if keep is None:
keep = []
if remove is None:
remove = []
if type(remove) != list:
value = self.cache_get_attribute_value(guid, remove)
if value is not None: