def _count_hostgroups(self):
self._log.debug('Counting host groups...')
results = self._search(
'cn=hostgroups,cn=accounts,%s' % self._base_dn,
'(objectClass=*)',
['numSubordinates'],
scope=ldap.SCOPE_BASE
)
dn, attrs = results[0]
return attrs['numSubordinates'][0].decode('utf-8')
评论列表
文章目录