Added env.enable_ra variable and change cert.py and ra.py plugin modules to register plugins conditionally

This commit is contained in:
Jason Gerard DeRose
2009-02-11 13:07:19 -07:00
committed by Rob Crittenden
parent 0e6e11d2e3
commit e0fe732318
4 changed files with 89 additions and 83 deletions

View File

@@ -701,7 +701,7 @@ plugin (or plugins) is imported. For example:
1
>>> api.bootstrap(in_server=True) # We want to execute, not forward
>>> len(api.env)
38
39
`Env._bootstrap()`, which is called by `API.bootstrap()`, will create several
run-time variables that connot be overriden in configuration files or through

View File

@@ -115,6 +115,9 @@ DEFAULT_CONFIG = (
('prompt_all', False),
('interactive', True),
# Enable certain optional plugins:
('enable_ra', False),
# ********************************************************
# The remaining keys are never set from the values here!
# ********************************************************

View File

@@ -22,8 +22,10 @@
Command plugins for IPA-RA certificate operations.
"""
from ipalib import api, Command, Str, Int
from ipalib import api
if api.env.enable_ra:
from ipalib import Command, Str, Int
class cert_request(Command):
"""

View File

@@ -418,4 +418,5 @@ class ra(Backend):
# self.debug("IPA-RA: stderr: '%s'" % stderr)
return (p.returncode, stdout, stderr)
if api.env.enable_ra:
api.register(ra)