summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-09-25 10:36:40 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-09-29 17:09:02 +0200
commitfb5bf6857dce597ce7b94a8e1ea49cc5e3539b8c (patch)
treec18b03dd0b57b17a0eaf07dbee0d560ba4196b77
parent786cb2e8523e9fdc55bc343c027f8eed2ca09a41 (diff)
downloadfreeipa-keytab-4419.tar.gz
freeipa-keytab-4419.tar.xz
freeipa-keytab-4419.zip
debug changeskeytab-4419
-rw-r--r--install/share/wsgi.py21
-rw-r--r--ipalib/plugins/baseldap.py15
-rw-r--r--ipapython/dn.py6
3 files changed, 27 insertions, 15 deletions
diff --git a/install/share/wsgi.py b/install/share/wsgi.py
index 9f7d3f487..5205e8d6d 100644
--- a/install/share/wsgi.py
+++ b/install/share/wsgi.py
@@ -36,16 +36,13 @@ env._finalize_core(**dict(DEFAULT_CONFIG))
# Initialize the API with the proper debug level
api.bootstrap(context='server', debug=env.debug, log=None)
-try:
- api.finalize()
-except StandardError, e:
- api.log.error('Failed to start IPA: %s' % e)
-else:
- api.log.info('*** PROCESS START ***')
- # This is the WSGI callable:
- def application(environ, start_response):
- if not environ['wsgi.multithread']:
- return api.Backend.wsgi_dispatch(environ, start_response)
- else:
- api.log.error("IPA does not work with the threaded MPM, use the pre-fork MPM")
+api.finalize()
+
+
+# This is the WSGI callable:
+def application(environ, start_response):
+ if not environ['wsgi.multithread']:
+ return api.Backend.wsgi_dispatch(environ, start_response)
+ else:
+ api.log.error("IPA does not work with the threaded MPM, use the pre-fork MPM")
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 26b43b90d..ad1b8b0fb 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -24,6 +24,8 @@ import re
import time
from copy import deepcopy
import base64
+import pprint
+import traceback
from ipalib import api, crud, errors
from ipalib import Method, Object, Command
@@ -738,12 +740,14 @@ def _check_limit_object_class(attributes, attrs, allow_only):
if len(attributes[0]) == 0 and len(attributes[1]) == 0:
return
limitattrs = deepcopy(attrs)
+ pp = pprint.PrettyPrinter(indent=4)
+ pp.pprint(attributes)
# Go through the MUST first
for (oid, attr) in attributes[0].iteritems():
if attr.names[0].lower() in limitattrs:
if not allow_only:
raise errors.ObjectclassViolation(
- info=_('attribute "%(attribute)s" not allowed') % dict(
+ info=_('attribute a "%(attribute)s" not allowed') % dict(
attribute=attr.names[0].lower()))
limitattrs.remove(attr.names[0].lower())
# And now the MAY
@@ -751,12 +755,12 @@ def _check_limit_object_class(attributes, attrs, allow_only):
if attr.names[0].lower() in limitattrs:
if not allow_only:
raise errors.ObjectclassViolation(
- info=_('attribute "%(attribute)s" not allowed') % dict(
+ info=_('attribute b "%(attribute)s" not allowed') % dict(
attribute=attr.names[0].lower()))
limitattrs.remove(attr.names[0].lower())
if len(limitattrs) > 0 and allow_only:
raise errors.ObjectclassViolation(
- info=_('attribute "%(attribute)s" not allowed') % dict(
+ info=_('attribute c "%(attribute)s" not allowed') % dict(
attribute=limitattrs[0]))
@@ -1642,6 +1646,11 @@ class LDAPAddMember(LDAPModMember):
try:
ldap.add_entry_to_group(m_dn, dn, attr, allow_same=self.allow_same)
except errors.PublicError, e:
+ print e
+ traceback.print_exc()
+ print ldap_obj_name
+ print attr
+ print m_dn
ldap_obj = self.api.Object[ldap_obj_name]
failed[attr][ldap_obj_name].append((
ldap_obj.get_primary_key_from_dn(m_dn),
diff --git a/ipapython/dn.py b/ipapython/dn.py
index 834291fbe..2d01ab708 100644
--- a/ipapython/dn.py
+++ b/ipapython/dn.py
@@ -1273,6 +1273,12 @@ class DN(object):
def __str__(self):
return dn2str(self._to_openldap())
+ def __json__(self):
+ return unicode(self.__str__())
+
+ def to_JSON(self):
+ return self.__json__()
+
def __repr__(self):
return "%s.%s('%s')" % (self.__module__, self.__class__.__name__, self.__str__())