mirror of
https://github.com/samba-team/samba.git
synced 2025-12-16 00:23:52 +03:00
python:samba:netcmd: Fix code spelling
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andreas Schneider
parent
de2c4879ce
commit
e046986d04
@@ -254,21 +254,21 @@ class cmd_listobjects(Command):
|
||||
except Exception as e:
|
||||
raise CommandError('Invalid ou_dn "%s": %s' % (ou_dn, e))
|
||||
|
||||
minchilds = 0
|
||||
minchildren = 0
|
||||
scope = ldb.SCOPE_ONELEVEL
|
||||
if recursive:
|
||||
minchilds = 1
|
||||
minchildren = 1
|
||||
scope = ldb.SCOPE_SUBTREE
|
||||
|
||||
try:
|
||||
childs = samdb.search(base=full_ou_dn,
|
||||
expression="(objectclass=*)",
|
||||
scope=scope, attrs=[])
|
||||
if len(childs) <= minchilds:
|
||||
children = samdb.search(base=full_ou_dn,
|
||||
expression="(objectclass=*)",
|
||||
scope=scope, attrs=[])
|
||||
if len(children) <= minchildren:
|
||||
self.outf.write('ou "%s" is empty\n' % ou_dn)
|
||||
return
|
||||
|
||||
for child in sorted(childs, key=attrgetter('dn')):
|
||||
for child in sorted(children, key=attrgetter('dn')):
|
||||
if child.dn == full_ou_dn:
|
||||
continue
|
||||
if not full_dn:
|
||||
|
||||
Reference in New Issue
Block a user