示例#1
0
 def _delete(self):
     if self.dn == '':
         raise LDAPCannotRemoveRootError()
     if self._sync_children():
         raise ldaperrors.LDAPNotAllowedOnNonLeaf(
             u'Cannot remove entry with children: %s' % self.dn.getText())
     assert self.path.endswith(u'.dir')
     entryPath = u'%s.ldif' % self.path[:-len(u'.dir')]
     os.remove(entryPath)
     return self
示例#2
0
 def _delete(self):
     if self.dn == '':  ##TODO DistinguishedName __nonzero__
         raise LDAPCannotRemoveRootError
     if self._sync_children():
         raise ldaperrors.LDAPNotAllowedOnNonLeaf(
             'Cannot remove entry with children: %s' % self.dn)
     assert self.path.endswith('.dir')
     entryPath = '%s.ldif' % self.path[:-len('.dir')]
     os.remove(entryPath)
     return self
示例#3
0
 def _delete(self):
     if self._parent is None:
         raise LDAPCannotRemoveRootError()
     if self._children:
         raise ldaperrors.LDAPNotAllowedOnNonLeaf(self.dn)
     return self._parent.deleteChild(self.dn.split()[0])