mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipaserver/plugins/trust.py; fix some indenting issues
Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
This commit is contained in:
@@ -318,15 +318,17 @@ def generate_creds(trustinstance, style, **options):
|
|||||||
elif style == CRED_STYLE_KERBEROS:
|
elif style == CRED_STYLE_KERBEROS:
|
||||||
sp = admin_name.split('\\')
|
sp = admin_name.split('\\')
|
||||||
if len(sp) > 1:
|
if len(sp) > 1:
|
||||||
sp = [sp[1]]
|
sp = [sp[1]]
|
||||||
else:
|
else:
|
||||||
sp = admin_name.split(sep)
|
sp = admin_name.split(sep)
|
||||||
if len(sp) == 1:
|
if len(sp) == 1:
|
||||||
sp.append(trustinstance.remote_domain.info['dns_domain'].upper())
|
sp.append(trustinstance.remote_domain
|
||||||
|
.info['dns_domain'].upper())
|
||||||
creds = u"{name}%{password}".format(name=sep.join(sp),
|
creds = u"{name}%{password}".format(name=sep.join(sp),
|
||||||
password=password)
|
password=password)
|
||||||
return creds
|
return creds
|
||||||
|
|
||||||
|
|
||||||
def add_range(myapi, trustinstance, range_name, dom_sid, *keys, **options):
|
def add_range(myapi, trustinstance, range_name, dom_sid, *keys, **options):
|
||||||
"""
|
"""
|
||||||
First, we try to derive the parameters of the ID range based on the
|
First, we try to derive the parameters of the ID range based on the
|
||||||
@@ -357,7 +359,7 @@ def add_range(myapi, trustinstance, range_name, dom_sid, *keys, **options):
|
|||||||
# CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System
|
# CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System
|
||||||
info_filter = '(objectClass=msSFU30DomainInfo)'
|
info_filter = '(objectClass=msSFU30DomainInfo)'
|
||||||
info_dn = DN('CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System')\
|
info_dn = DN('CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System')\
|
||||||
+ basedn
|
+ basedn
|
||||||
|
|
||||||
# Get the domain validator
|
# Get the domain validator
|
||||||
domain_validator = ipaserver.dcerpc.DomainValidator(myapi)
|
domain_validator = ipaserver.dcerpc.DomainValidator(myapi)
|
||||||
@@ -405,7 +407,7 @@ def add_range(myapi, trustinstance, range_name, dom_sid, *keys, **options):
|
|||||||
|
|
||||||
base_id = int(info.get('msSFU30OrderNumber')[0])
|
base_id = int(info.get('msSFU30OrderNumber')[0])
|
||||||
range_size = (1 + (max_id - base_id) // DEFAULT_RANGE_SIZE)\
|
range_size = (1 + (max_id - base_id) // DEFAULT_RANGE_SIZE)\
|
||||||
* DEFAULT_RANGE_SIZE
|
* DEFAULT_RANGE_SIZE
|
||||||
|
|
||||||
# Second, options given via the CLI options take precedence to discovery
|
# Second, options given via the CLI options take precedence to discovery
|
||||||
if options.get('range_type', None):
|
if options.get('range_type', None):
|
||||||
@@ -635,11 +637,10 @@ class trust(LDAPObject):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
add_message(
|
add_message(
|
||||||
options['version'],
|
options['version'],
|
||||||
result,
|
result,
|
||||||
BrokenTrust(domain=entry.single_value['cn'])
|
BrokenTrust(domain=entry.single_value['cn']))
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@register()
|
@register()
|
||||||
|
|||||||
Reference in New Issue
Block a user