summaryrefslogtreecommitdiffstats
path: root/ipalib/frontend.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-01-19 11:24:31 -0500
committerSimo Sorce <ssorce@redhat.com>2011-01-28 18:49:17 -0500
commit359d54e741877f04b0773fb0955041eee7ec0054 (patch)
tree8a1c69754da14a502d809330e2f8f7831ff0c16b /ipalib/frontend.py
parentfd1d0857b5b559425668f38d85a7d607d0f35767 (diff)
downloadfreeipa-359d54e741877f04b0773fb0955041eee7ec0054.tar.gz
freeipa-359d54e741877f04b0773fb0955041eee7ec0054.tar.xz
freeipa-359d54e741877f04b0773fb0955041eee7ec0054.zip
Don't perform some API self-tests in production mode for performance reasons
The API does a fair number of self tests and locking to assure that the registered commands are consistent and will work. This does not need to be done on a production system and adds additional overhead causing somewhere between a 30 and 50% decrease in performance. Because makeapi is executed when a build is done ensure that it is executed in developer mode to ensure that the framework is ok. ticket 751
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r--ipalib/frontend.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 58fd4d640..cf78d441f 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -351,9 +351,10 @@ class HasParam(Plugin):
self._filter_param_by_context(name, env),
sort=False
)
- check = getattr(self, 'check_' + name, None)
- if callable(check):
- check(namespace)
+ if self.env.mode != 'production':
+ check = getattr(self, 'check_' + name, None)
+ if callable(check):
+ check(namespace)
setattr(self, name, namespace)