コード例 #1
0
ファイル: ldap_glue.py プロジェクト: B-Rich/smart
	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)))
コード例 #2
0
ファイル: ldap_glue.py プロジェクト: bopopescu/smart-1
    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)))
コード例 #3
0
ファイル: ldap_glue.py プロジェクト: bopopescu/smart-1
 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)
コード例 #4
0
ファイル: ldap_glue.py プロジェクト: bopopescu/smart-1
 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)
コード例 #5
0
ファイル: ldap_glue.py プロジェクト: bopopescu/smart-1
 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)
コード例 #6
0
ファイル: ldap_glue.py プロジェクト: bopopescu/smart-1
 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)
コード例 #7
0
ファイル: ldap_glue.py プロジェクト: bopopescu/smart-1
 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)
コード例 #8
0
ファイル: ldap_glue.py プロジェクト: bopopescu/smart-1
 def delete(self, dn):
     """Delete LDAP object at 'dn'."""
     self.lo.delete_s(compatible_modstring(unicode(dn)))
コード例 #9
0
ファイル: ldap_glue.py プロジェクト: B-Rich/smart
	def delete(self, dn):
		"""Delete LDAP object at 'dn'."""
		self.lo.delete_s(compatible_modstring(unicode(dn)))
コード例 #10
0
ファイル: ldap_glue.py プロジェクト: B-Rich/smart
	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)
コード例 #11
0
ファイル: ldap_glue.py プロジェクト: B-Rich/smart
	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)
コード例 #12
0
ファイル: ldap_glue.py プロジェクト: B-Rich/smart
	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)
コード例 #13
0
ファイル: ldap_glue.py プロジェクト: B-Rich/smart
	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)
コード例 #14
0
ファイル: ldap_glue.py プロジェクト: B-Rich/smart
	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)