From da21ff82a50190da9023ef39046ec967d389ef97 Mon Sep 17 00:00:00 2001 From: Giampaolo Lauria Date: Mon, 7 Nov 2011 13:39:07 -0500 Subject: samba-tool: Change internal argument name in domain machinepassword --- source4/scripting/python/samba/netcmd/domain.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index af86a44d6d..871f72f952 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -341,20 +341,20 @@ class cmd_domain_machinepassword(Command): synopsis = "%prog [options]" - takes_args = ["secret"] + takes_args = ["accountname"] - def run(self, secret, sambaopts=None, credopts=None, versionopts=None): + def run(self, accountname, sambaopts=None, credopts=None, versionopts=None): lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp, fallback_machine=True) url = lp.private_path("secrets.ldb") if not os.path.exists(url): raise CommandError("secrets database not found at %s " % url) - if not secret.endswith('$'): - secret += '$' + if not accountname.endswith('$'): + accountname += '$' secretsdb = Ldb(url=url, session_info=system_session(), credentials=creds, lp=lp) result = secretsdb.search(attrs=["secret"], - expression="(&(objectclass=primaryDomain)(samaccountname=%s))" % ldb.binary_encode(secret)) + expression="(&(objectclass=primaryDomain)(samaccountname=%s))" % ldb.binary_encode(accountname)) if len(result) != 1: raise CommandError("search returned %d records, expected 1" % len(result)) -- cgit