Beispiel #1
0
	def move(self, dn, newdn):
		"""Move LDAP object from 'dn' to 'newdn'."""
		newrdn = get_rdn(newdn)
		parent1 = get_parent_dn(dn)
		parent2 = get_parent_dn(newdn)
		
		if parent1 != parent2:
			self.lo.rename_s(compatible_modstring(unicode(dn)),
					compatible_modstring(unicode(newrdn)),
					compatible_modstring(unicode(parent2)))
		else:
			self.lo.modrdn_s(compatible_modstring(unicode(dn)),
					compatible_modstring(unicode(newrdn)))
Beispiel #2
0
    def move(self, dn, newdn):
        """Move LDAP object from 'dn' to 'newdn'."""
        newrdn = get_rdn(newdn)
        parent1 = get_parent_dn(dn)
        parent2 = get_parent_dn(newdn)

        if parent1 != parent2:
            self.lo.rename_s(compatible_modstring(unicode(dn)),
                             compatible_modstring(unicode(newrdn)),
                             compatible_modstring(unicode(parent2)))
        else:
            self.lo.modrdn_s(compatible_modstring(unicode(dn)),
                             compatible_modstring(unicode(newrdn)))
Beispiel #3
0
 def create(self, dn, attrs):
     """Create LDAP object at 'dn' with attributes 'attrs'."""
     ldif = modlist.addModlist(attrs)
     self.lo.add_s(compatible_modstring(unicode(dn)), ldif)
Beispiel #4
0
 def remove_from_attribute(self, dn, key, value):
     """Remove 'value' from attribute 'key' of LDAP object at 'dn'."""
     ml = [(ldap.MOD_DELETE, key, compatible_modstring(unicode(value)))]
     self.lo.modify_s(compatible_modstring(unicode(dn)), ml)
Beispiel #5
0
 def append_to_attribute(self, dn, key, value):
     """Add 'value' to attribute 'key' of LDAP object at 'dn'."""
     ml = [(ldap.MOD_ADD, key, compatible_modstring(unicode(value)))]
     self.lo.modify_s(compatible_modstring(unicode(dn)), ml)
Beispiel #6
0
 def delete_attribute(self, dn, key):
     """Delete attribute 'key' of LDAP object at 'dn'."""
     ml = [(ldap.MOD_DELETE, key, None)]
     self.lo.modify_s(compatible_modstring(unicode(dn)), ml)
Beispiel #7
0
 def set_attribute(self, dn, key, value):
     """Set attribute 'key' of LDAP object at 'dn' to 'value'."""
     ml = [(ldap.MOD_REPLACE, key, compatible_modstring(unicode(value)))]
     self.lo.modify_s(compatible_modstring(unicode(dn)), ml)
Beispiel #8
0
 def delete(self, dn):
     """Delete LDAP object at 'dn'."""
     self.lo.delete_s(compatible_modstring(unicode(dn)))
Beispiel #9
0
	def delete(self, dn):
		"""Delete LDAP object at 'dn'."""
		self.lo.delete_s(compatible_modstring(unicode(dn)))
Beispiel #10
0
	def create(self, dn, attrs):
		"""Create LDAP object at 'dn' with attributes 'attrs'."""
		ldif = modlist.addModlist(attrs)
		self.lo.add_s(compatible_modstring(unicode(dn)), ldif)
Beispiel #11
0
	def remove_from_attribute(self, dn, key, value):
		"""Remove 'value' from attribute 'key' of LDAP object at 'dn'."""
		ml = [(ldap.MOD_DELETE, key, compatible_modstring(unicode(value)))]
		self.lo.modify_s(compatible_modstring(unicode(dn)), ml)
Beispiel #12
0
	def append_to_attribute(self, dn, key, value):
		"""Add 'value' to attribute 'key' of LDAP object at 'dn'."""
		ml = [(ldap.MOD_ADD, key, compatible_modstring(unicode(value)))]
		self.lo.modify_s(compatible_modstring(unicode(dn)), ml)
Beispiel #13
0
	def delete_attribute(self, dn, key):
		"""Delete attribute 'key' of LDAP object at 'dn'."""
		ml = [(ldap.MOD_DELETE, key, None)]
		self.lo.modify_s(compatible_modstring(unicode(dn)), ml)
Beispiel #14
0
	def set_attribute(self, dn, key, value):
		"""Set attribute 'key' of LDAP object at 'dn' to 'value'."""
		ml = [(ldap.MOD_REPLACE, key, compatible_modstring(unicode(value)))]
		self.lo.modify_s(compatible_modstring(unicode(dn)), ml)