From f8ad7cb96f065ca0dc557d8be95fd33a95d34d17 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 23 Jan 2013 09:27:05 -0500 Subject: Replace addEntry with add_entry Part of the work for: https://fedorahosted.org/freeipa/ticket/2660 --- ipaserver/install/adtrustinstance.py | 8 ++++---- ipaserver/install/cainstance.py | 2 +- ipaserver/install/dsinstance.py | 2 +- ipaserver/install/krbinstance.py | 6 +++--- ipaserver/install/ldapupdate.py | 4 ++-- ipaserver/install/replication.py | 18 +++++++++--------- ipaserver/install/service.py | 6 +++--- 7 files changed, 23 insertions(+), 23 deletions(-) (limited to 'ipaserver/install') diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py index fe1ef53a..361587d0 100644 --- a/ipaserver/install/adtrustinstance.py +++ b/ipaserver/install/adtrustinstance.py @@ -333,7 +333,7 @@ class ADTRUSTInstance(service.Service): return entry = self.admin_conn.make_entry( new_dn, objectclass=['nsContainer'], cn=[name]) - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) entry = self.admin_conn.make_entry( self.smb_dom_dn, @@ -346,7 +346,7 @@ class ADTRUSTInstance(service.Service): } ) #TODO: which MAY attributes do we want to set ? - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) def __write_smb_conf(self): self.fstore.backup_file(self.smb_conf) @@ -458,7 +458,7 @@ class ADTRUSTInstance(service.Service): cn=[self.smb_dn['cn']], member=[self.cifs_agent], ) - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) except Exception, e: # CIFS principal already exists, it is not the first time adtrustinstance is managed # That's fine, we we'll re-extract the key again. @@ -745,7 +745,7 @@ class ADTRUSTInstance(service.Service): ipaBaseID=[str(base_id)], ipaIDRangeSize=[str(id_range_size)], ) - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) def create_instance(self): diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py index 1c97041a..1f2dacc0 100644 --- a/ipaserver/install/cainstance.py +++ b/ipaserver/install/cainstance.py @@ -397,7 +397,7 @@ class CADSInstance(service.Service): nsSSLToken=["internal (software)"], nsSSLActivation=["on"], ) - conn.addEntry(entry) + conn.add_entry(entry) conn.unbind() diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py index 5e69f214..de902437 100644 --- a/ipaserver/install/dsinstance.py +++ b/ipaserver/install/dsinstance.py @@ -578,7 +578,7 @@ class DsInstance(service.Service): nsSSLToken=["internal (software)"], nsSSLActivation=["on"], ) - conn.addEntry(entry) + conn.add_entry(entry) conn.unbind() diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py index 11cde1ca..71490603 100644 --- a/ipaserver/install/krbinstance.py +++ b/ipaserver/install/krbinstance.py @@ -131,7 +131,7 @@ class KrbInstance(service.Service): 'krbpasswordexpiration'] if 'krbticketflags' in service_entry.toDict(): host_entry['krbticketflags'] = service_entry['krbticketflags'] - self.admin_conn.addEntry(host_entry) + self.admin_conn.add_entry(host_entry) def __common_setup(self, realm_name, host_name, domain_name, admin_password): self.fqdn = host_name @@ -282,7 +282,7 @@ class KrbInstance(service.Service): nsSaslMapBaseDNTemplate=[self.suffix], nsSaslMapFilterTemplate=['(krbPrincipalName=\\1@\\2)'], ) - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) entry = self.admin_conn.make_entry( DN( @@ -295,7 +295,7 @@ class KrbInstance(service.Service): nsSaslMapFilterTemplate=[ '(krbPrincipalName=&@%s)' % self.realm], ) - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) def __add_krb_container(self): self._ldap_mod("kerberos.ldif", self.sub_dict) diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index 16a47a88..aaef1c71 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -428,7 +428,7 @@ class LDAPUpdate: self.debug("Task id: %s", dn) if self.live_run: - self.conn.addEntry(e) + self.conn.add_entry(e) return dn @@ -769,7 +769,7 @@ class LDAPUpdate: # dn defined. In that case there is nothing to do. # It means the entry doesn't exist, so skip it. try: - self.conn.addEntry(entry) + self.conn.add_entry(entry) except errors.NotFound: # parent entry of the added entry does not exist # this may not be an error (e.g. entries in NIS container) diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index 32ea5220..570471d6 100644 --- a/ipaserver/install/replication.py +++ b/ipaserver/install/replication.py @@ -323,7 +323,7 @@ class ReplicationManager(object): ) try: - conn.addEntry(ent) + conn.add_entry(ent) except errors.DuplicateEntry: conn.modify_s(dn, [(ldap.MOD_REPLACE, "userpassword", pw)]) pass @@ -377,7 +377,7 @@ class ReplicationManager(object): nsds5replicabinddn=[replica_binddn], nsds5replicalegacyconsumer=["off"], ) - conn.addEntry(entry) + conn.add_entry(entry) def setup_changelog(self, conn): ent = conn.get_entry( @@ -396,7 +396,7 @@ class ReplicationManager(object): } ) try: - conn.addEntry(entry) + conn.add_entry(entry) except errors.DuplicateEntry: return @@ -423,7 +423,7 @@ class ReplicationManager(object): 'nsmultiplexorcredentials': [self.repl_man_passwd], } ) - self.conn.addEntry(entry) + self.conn.add_entry(entry) done = True except errors.DuplicateEntry: benum += 1 @@ -493,7 +493,7 @@ class ReplicationManager(object): uid=["passsync"], userPassword=[password], ) - conn.addEntry(entry) + conn.add_entry(entry) # Add it to the list of users allowed to bypass password policy extop_dn = DN(('cn', 'ipa_pwd_extop'), ('cn', 'plugins'), ('cn', 'config')) @@ -586,7 +586,7 @@ class ReplicationManager(object): if iswinsync: self.setup_winsync_agmt(entry, win_subtree) - a_conn.addEntry(entry) + a_conn.add_entry(entry) try: mod = [(ldap.MOD_ADD, 'nsDS5ReplicatedAttributeListTotal', @@ -969,7 +969,7 @@ class ReplicationManager(object): ) try: - self.conn.addEntry(entry) + self.conn.add_entry(entry) except Exception, e: root_logger.info("Failed to create public entry for winsync replica") @@ -1225,7 +1225,7 @@ class ReplicationManager(object): } ) try: - self.conn.addEntry(e) + self.conn.add_entry(e) except errors.DuplicateEntry: print "CLEANALLRUV task for replica id %d already exists." % replicaId else: @@ -1252,7 +1252,7 @@ class ReplicationManager(object): } ) try: - self.conn.addEntry(e) + self.conn.add_entry(e) except errors.DuplicateEntry: print "An abort CLEANALLRUV task for replica id %d already exists." % replicaId else: diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py index dde36a82..f15646af 100644 --- a/ipaserver/install/service.py +++ b/ipaserver/install/service.py @@ -202,7 +202,7 @@ class Service(object): entry["objectclass"] = list(set(classes)) entry["ipauniqueid"] = ['autogenerate'] entry["managedby"] = [hostdn] - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) return newdn def add_simple_service(self, principal): @@ -225,7 +225,7 @@ class Service(object): ipauniqueid=['autogenerate'], managedby=[hostdn], ) - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) return dn def add_cert_to_service(self): @@ -386,7 +386,7 @@ class Service(object): ) try: - self.admin_conn.addEntry(entry) + self.admin_conn.add_entry(entry) except (ldap.ALREADY_EXISTS, errors.DuplicateEntry), e: root_logger.debug("failed to add %s Service startup entry" % name) raise e -- cgit