#!/usr/bin/python __package__ = '' # workaround for PEP 366 import sys name = 'exit' description = 'Exit' filter = '(objectClass=organizationalRole)' attributes = ['description'] def handler(dn, new, old, command=''): with open('/tmp/log', 'a') as log: print >> log, dn print >> log, new print >> log, old print >> log, command if 'exit' in new.get('description'): sys.exit(1)