mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Convert remaining installer code to LDAPEntry API.
This commit is contained in:
committed by
Petr Viktorin
parent
a5f322cb7b
commit
08051f1651
@@ -472,7 +472,7 @@ class ADTRUSTInstance(service.Service):
|
||||
members = current.get('memberPrincipal', [])
|
||||
if not(self.cifs_principal in members):
|
||||
current["memberPrincipal"] = members + [self.cifs_principal]
|
||||
self.admin_conn.update_entry(targets_dn, current)
|
||||
self.admin_conn.update_entry(current)
|
||||
else:
|
||||
self.print_msg('cifs principal already targeted, nothing to do.')
|
||||
except errors.NotFound:
|
||||
@@ -503,7 +503,7 @@ class ADTRUSTInstance(service.Service):
|
||||
members = current.get('member', [])
|
||||
if not(self.cifs_agent in members):
|
||||
current["member"] = members + [self.cifs_agent]
|
||||
self.admin_conn.update_entry(self.smb_dn, current)
|
||||
self.admin_conn.update_entry(current)
|
||||
except errors.NotFound:
|
||||
entry = self.admin_conn.make_entry(
|
||||
self.smb_dn,
|
||||
@@ -723,7 +723,7 @@ class ADTRUSTInstance(service.Service):
|
||||
lookup_nsswitch = current.get(lookup_nsswitch_name, [])
|
||||
if not(config[1] in lookup_nsswitch):
|
||||
current[lookup_nsswitch_name] = [config[1]]
|
||||
self.admin_conn.update_entry(entry_dn, current)
|
||||
self.admin_conn.update_entry(current)
|
||||
except Exception, e:
|
||||
root_logger.critical("Enabling nsswitch support in slapi-nis failed with error '%s'" % e)
|
||||
|
||||
|
||||
@@ -930,21 +930,22 @@ class CAInstance(service.Service):
|
||||
decoded = base64.b64decode(self.ra_cert)
|
||||
|
||||
entry_dn = DN(('uid', "ipara"), ('ou', 'People'), self.basedn)
|
||||
entry = [
|
||||
('objectClass', ['top', 'person', 'organizationalPerson', 'inetOrgPerson', 'cmsuser']),
|
||||
('uid', "ipara"),
|
||||
('sn', "ipara"),
|
||||
('cn', "ipara"),
|
||||
('usertype', "agentType"),
|
||||
('userstate', "1"),
|
||||
('userCertificate', decoded),
|
||||
('description', '2;%s;%s;%s' % \
|
||||
(str(self.requestId),
|
||||
DN(('CN', 'Certificate Authority'), self.subject_base),
|
||||
DN(('CN', 'IPA RA'), self.subject_base))),
|
||||
]
|
||||
entry = conn.make_entry(
|
||||
entry_dn,
|
||||
objectClass=['top', 'person', 'organizationalPerson',
|
||||
'inetOrgPerson', 'cmsuser'],
|
||||
uid=["ipara"],
|
||||
sn=["ipara"],
|
||||
cn=["ipara"],
|
||||
usertype=["agentType"],
|
||||
userstate=["1"],
|
||||
userCertificate=[decoded],
|
||||
description=['2;%s;%s;%s' % (
|
||||
str(self.requestId),
|
||||
DN(('CN', 'Certificate Authority'), self.subject_base),
|
||||
DN(('CN', 'IPA RA'), self.subject_base))])
|
||||
|
||||
conn.add_entry(entry_dn, entry)
|
||||
conn.add_entry(entry)
|
||||
|
||||
dn = DN(('cn', 'Certificate Manager Agents'), ('ou', 'groups'), self.basedn)
|
||||
modlist = [(0, 'uniqueMember', '%s' % entry_dn)]
|
||||
@@ -1764,11 +1765,11 @@ def update_people_entry(uid, dercert):
|
||||
conn = ldap2.ldap2(shared_instance=False, ldap_uri=dogtag_uri)
|
||||
conn.connect(bind_dn=DN(('cn', 'directory manager')),
|
||||
bind_pw=dm_password)
|
||||
(entry_dn, entry_attrs) = conn.get_entry(dn, ['usercertificate'])
|
||||
entry_attrs = conn.get_entry(dn, ['usercertificate'])
|
||||
entry_attrs['usercertificate'].append(dercert)
|
||||
entry_attrs['description'] = '2;%d;%s;%s' % (serial_number, issuer,
|
||||
subject)
|
||||
conn.update_entry(dn, entry_attrs)
|
||||
conn.update_entry(entry_attrs)
|
||||
updated = True
|
||||
break
|
||||
except errors.NetworkError:
|
||||
|
||||
@@ -162,7 +162,7 @@ class ReplicaPrepare(admintool.AdminTool):
|
||||
conn = ldap2(shared_instance=False, base_dn=suffix)
|
||||
conn.connect(bind_dn=DN(('cn', 'directory manager')),
|
||||
bind_pw=self.dirman_password)
|
||||
dn, entry_attrs = conn.get_ipa_config()
|
||||
entry_attrs = conn.get_ipa_config()
|
||||
conn.disconnect()
|
||||
except errors.ACIError:
|
||||
raise admintool.ScriptError("The password provided is incorrect "
|
||||
|
||||
Reference in New Issue
Block a user