mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Added env.enable_ra variable and change cert.py and ra.py plugin modules to register plugins conditionally
This commit is contained in:
committed by
Rob Crittenden
parent
0e6e11d2e3
commit
e0fe732318
@@ -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
|
||||
|
||||
@@ -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!
|
||||
# ********************************************************
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
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):
|
||||
class cert_request(Command):
|
||||
"""
|
||||
Submit a certificate singing request.
|
||||
"""
|
||||
@@ -45,10 +47,10 @@ class cert_request(Command):
|
||||
else:
|
||||
textui.print_plain('Failed to submit a certificate request.')
|
||||
|
||||
api.register(cert_request)
|
||||
api.register(cert_request)
|
||||
|
||||
|
||||
class cert_status(Command):
|
||||
class cert_status(Command):
|
||||
"""
|
||||
Check status of a certificate signing request.
|
||||
"""
|
||||
@@ -65,10 +67,10 @@ class cert_status(Command):
|
||||
else:
|
||||
textui.print_plain('Failed to retrieve a request status.')
|
||||
|
||||
api.register(cert_status)
|
||||
api.register(cert_status)
|
||||
|
||||
|
||||
class cert_get(Command):
|
||||
class cert_get(Command):
|
||||
"""
|
||||
Retrieve an existing certificate.
|
||||
"""
|
||||
@@ -84,10 +86,10 @@ class cert_get(Command):
|
||||
else:
|
||||
textui.print_plain('Failed to obtain a certificate.')
|
||||
|
||||
api.register(cert_get)
|
||||
api.register(cert_get)
|
||||
|
||||
|
||||
class cert_revoke(Command):
|
||||
class cert_revoke(Command):
|
||||
"""
|
||||
Revoke a certificate.
|
||||
"""
|
||||
@@ -107,10 +109,10 @@ class cert_revoke(Command):
|
||||
else:
|
||||
textui.print_plain('Failed to revoke a certificate.')
|
||||
|
||||
api.register(cert_revoke)
|
||||
api.register(cert_revoke)
|
||||
|
||||
|
||||
class cert_remove_hold(Command):
|
||||
class cert_remove_hold(Command):
|
||||
"""
|
||||
Take a revoked certificate off hold.
|
||||
"""
|
||||
@@ -126,4 +128,4 @@ class cert_remove_hold(Command):
|
||||
else:
|
||||
textui.print_plain('Failed to take a revoked certificate off hold.')
|
||||
|
||||
api.register(cert_remove_hold)
|
||||
api.register(cert_remove_hold)
|
||||
|
||||
@@ -418,4 +418,5 @@ class ra(Backend):
|
||||
# self.debug("IPA-RA: stderr: '%s'" % stderr)
|
||||
return (p.returncode, stdout, stderr)
|
||||
|
||||
api.register(ra)
|
||||
if api.env.enable_ra:
|
||||
api.register(ra)
|
||||
|
||||
Reference in New Issue
Block a user