本文整理汇总了Python中freenasUI.common.freenasldap.FreeNAS_ActiveDirectory.workgroups方法的典型用法代码示例。如果您正苦于以下问题:Python FreeNAS_ActiveDirectory.workgroups方法的具体用法?Python FreeNAS_ActiveDirectory.workgroups怎么用?Python FreeNAS_ActiveDirectory.workgroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类freenasUI.common.freenasldap.FreeNAS_ActiveDirectory
的用法示例。
在下文中一共展示了FreeNAS_ActiveDirectory.workgroups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: directoryservice
# 需要导入模块: from freenasUI.common.freenasldap import FreeNAS_ActiveDirectory [as 别名]
# 或者: from freenasUI.common.freenasldap.FreeNAS_ActiveDirectory import workgroups [as 别名]
def directoryservice(self, name):
"""Temporary rapper to serialize DS connectors"""
if name == 'AD':
ds = FreeNAS_ActiveDirectory(flags=FLAGS_DBINIT)
workgroups = []
domains = ds.get_domains()
for d in domains:
if 'nETBIOSName' in d:
netbiosname = d['nETBIOSName']
workgroups.append(netbiosname)
ds.workgroups = workgroups
elif name == 'LDAP':
ds = FreeNAS_LDAP(flags=FLAGS_DBINIT)
else:
raise ValueError('Unknown ds name {0}'.format(name))
data = {}
for i in (
'netbiosname', 'keytab_file', 'keytab_principal', 'domainname',
'use_default_domain', 'dchost', 'basedn', 'binddn', 'bindpw',
'userdn', 'groupdn', 'ssl', 'certfile', 'id',
'ad_idmap_backend', 'ds_type',
'krb_realm', 'krbname', 'kpwdname',
'krb_kdc', 'krb_admin_server', 'krb_kpasswd_server',
'workgroups'
):
if hasattr(ds, i):
data[i] = getattr(ds, i)
return data