From ce8b5d520bafe10fb048f5c61197c840263decb6 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 7 Nov 2011 17:57:52 +0100 Subject: s4:samba-tool - fix Gémes Géza patch regarding parameter handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new "random-password" parameter has not been evaluated correctly. Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Mon Nov 7 19:35:05 CET 2011 on sn-devel-104 --- source4/scripting/python/samba/netcmd/user.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py index 78e09fd324..0ac4b23742 100644 --- a/source4/scripting/python/samba/netcmd/user.py +++ b/source4/scripting/python/samba/netcmd/user.py @@ -100,13 +100,13 @@ Example3 shows how to create a new user in the OrgUnit organizational unit. takes_args = ["username", "password?"] def run(self, username, password=None, credopts=None, sambaopts=None, - versionopts=None, H=None, must_change_at_next_login=None, random_password=False, + versionopts=None, H=None, must_change_at_next_login=None, random_password=None, use_username_as_cn=None, userou=None, surname=None, given_name=None, initials=None, profile_path=None, script_path=None, home_drive=None, home_directory=None, job_title=None, department=None, company=None, description=None, mail_address=None, internet_address=None, telephone_number=None, physical_delivery_office=None): - if random_password is not False: + if random_password is True: password = generate_random_password(128, 255) while 1: @@ -397,14 +397,15 @@ Example3 shows how an administrator would reset TestUser3 user's password to pas def run(self, username=None, filter=None, credopts=None, sambaopts=None, versionopts=None, H=None, newpassword=None, - must_change_at_next_login=None, random_password=False): + must_change_at_next_login=None, random_password=None): if filter is None and username is None: raise CommandError("Either the username or '--filter' must be specified!") - if random_password is not False: + if random_password is True: password = generate_random_password(128, 255) else: password = newpassword + while 1: if password is not None and password is not '': break -- cgit