summaryrefslogtreecommitdiffstats
path: root/ipaserver/advise
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2016-04-25 16:14:05 +0200
committerJan Cholasta <jcholast@redhat.com>2016-05-25 16:06:26 +0200
commit15a4c0d2767c0a37d55463d4bba60442a83539bb (patch)
tree8de3382c3af1ae8bbfa419e81abad3b60294afde /ipaserver/advise
parentbed546ee8220992084520737320a646dc47ec1e3 (diff)
downloadfreeipa-15a4c0d2767c0a37d55463d4bba60442a83539bb.tar.gz
freeipa-15a4c0d2767c0a37d55463d4bba60442a83539bb.tar.xz
freeipa-15a4c0d2767c0a37d55463d4bba60442a83539bb.zip
ipalib, ipaserver: fix incorrect API.register calls in docstrings
Use API.add_plugin to load specific plugins into API objects. Use Registry to register plugins. This fixes doctests. https://fedorahosted.org/freeipa/ticket/4739 https://fedorahosted.org/freeipa/ticket/5115 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/advise')
-rw-r--r--ipaserver/advise/base.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/ipaserver/advise/base.py b/ipaserver/advise/base.py
index c80a13b6c..d083a3c50 100644
--- a/ipaserver/advise/base.py
+++ b/ipaserver/advise/base.py
@@ -39,6 +39,9 @@ The class can run any arbitrary code or IPA command via api.Command['command']()
calls. It needs to override get_info() method, which returns the formatted
advice string.
+Important! Do not forget to register the class to the API.
+
+>>> @register()
>>> class sample_advice(Advice):
>>> description = 'Instructions for machine with SSSD 1.0 setup.'
@@ -69,10 +72,6 @@ As a result, you can redirect the advice's output directly to a script file.
# ipa-advise sample-advice > script.sh
# ./script.sh
-
-Important! Do not forget to register the class to the API.
-
->>> api.register(sample_advice)
"""