def whoami(self): try: current_dn = self.con.whoami_s() except ldap.LDAPError, e: print "[!] {}".format(e) sys.exit(1) return current_dn