summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-02-12 02:10:12 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-17 16:03:10 -0500
commit4ab133c3cb8fa9a9aff2b7e5d1c53a0feb164f3f (patch)
tree5e1989c8c054b05876a86ed81ebb6dea6f66b033 /ipaserver/plugins
parente0fe7323187df205c0994cc3fa4e0ee0b6445788 (diff)
downloadfreeipa-4ab133c3cb8fa9a9aff2b7e5d1c53a0feb164f3f.tar.gz
freeipa-4ab133c3cb8fa9a9aff2b7e5d1c53a0feb164f3f.tar.xz
freeipa-4ab133c3cb8fa9a9aff2b7e5d1c53a0feb164f3f.zip
Implemented more elegant way for entire plugin module to be conditionally skipped; updated cert.py and ra.py modules to use this
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/ra.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ipaserver/plugins/ra.py b/ipaserver/plugins/ra.py
index 622e4d9f..471276c3 100644
--- a/ipaserver/plugins/ra.py
+++ b/ipaserver/plugins/ra.py
@@ -31,6 +31,11 @@ certificates via the following methods:
* `ra.take_certificate_off_hold()` - take a certificate off hold.
"""
+from ipalib import api, SkipPluginModule
+
+if api.env.enable_ra is not True:
+ raise SkipPluginModule(reason='env.enable_ra=%r' % (api.env.enable_ra,))
+
import os, stat, subprocess
import array
import errno
@@ -40,7 +45,7 @@ from urllib import urlencode, quote
from socket import gethostname
import socket
-from ipalib import api, Backend
+from ipalib import Backend
from ipalib.errors2 import NetworkError
from ipaserver import servercore
from ipaserver import ipaldap
@@ -418,5 +423,4 @@ class ra(Backend):
# self.debug("IPA-RA: stderr: '%s'" % stderr)
return (p.returncode, stdout, stderr)
-if api.env.enable_ra:
- api.register(ra)
+api.register(ra)