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:
committed by
Andrew Bartlett
parent
e7c87b1d9b
commit
5cb8805811
@@ -1100,8 +1100,10 @@ sAMAccountName: %s
|
||||
self.assertCmdSuccess(result, out, err, "Error running user unlock")
|
||||
self.assertEqual(err, "", "Shouldn't be any error messages")
|
||||
|
||||
def _randomUser(self, base={}):
|
||||
def _randomUser(self, base=None):
|
||||
"""create a user with random attribute values, you can specify base attributes"""
|
||||
if base is None:
|
||||
base = {}
|
||||
user = {
|
||||
"name": self.randomName(),
|
||||
"password": self.random_password(16),
|
||||
@@ -1117,9 +1119,11 @@ sAMAccountName: %s
|
||||
user.update(base)
|
||||
return user
|
||||
|
||||
def _randomPosixUser(self, base={}):
|
||||
def _randomPosixUser(self, base=None):
|
||||
"""create a user with random attribute values and additional RFC2307
|
||||
attributes, you can specify base attributes"""
|
||||
if base is None:
|
||||
base = {}
|
||||
user = self._randomUser({})
|
||||
user.update(base)
|
||||
posixAttributes = {
|
||||
@@ -1135,9 +1139,11 @@ sAMAccountName: %s
|
||||
user.update(base)
|
||||
return user
|
||||
|
||||
def _randomUnixUser(self, base={}):
|
||||
def _randomUnixUser(self, base=None):
|
||||
"""create a user with random attribute values and additional RFC2307
|
||||
attributes, you can specify base attributes"""
|
||||
if base is None:
|
||||
base = {}
|
||||
user = self._randomUser({})
|
||||
user.update(base)
|
||||
posixAttributes = {
|
||||
|
||||
Reference in New Issue
Block a user