summaryrefslogtreecommitdiffstats
path: root/ipaserver/advise
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2013-08-06 12:27:53 +0200
committerMartin Kosek <mkosek@redhat.com>2013-08-06 15:54:47 +0200
commitd4bf153d646807b42f38bccbc19cd2690b5622bc (patch)
tree0c91bd1b137115ccb9e57b6831319d027287a96b /ipaserver/advise
parent8c8da71ea38c0082884c193c699a9f5d20b7e898 (diff)
downloadfreeipa-d4bf153d646807b42f38bccbc19cd2690b5622bc.tar.gz
freeipa-d4bf153d646807b42f38bccbc19cd2690b5622bc.tar.xz
freeipa-d4bf153d646807b42f38bccbc19cd2690b5622bc.zip
Add a word wrapping for comment log messages to AdviceLogger
The comments logged through AdviceLogger are now wrapped up to 70 characters. This change has been documented in the docstrings.
Diffstat (limited to 'ipaserver/advise')
-rw-r--r--ipaserver/advise/base.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipaserver/advise/base.py b/ipaserver/advise/base.py
index 4b6ee96f8..b26bbc6b3 100644
--- a/ipaserver/advise/base.py
+++ b/ipaserver/advise/base.py
@@ -46,7 +46,7 @@ Optionally, you can require root privileges for your plugin:
The following method should be implemented in your plugin:
->>>.....def get_info():
+>>> def get_info():
>>> self.log.debug('Entering execute() method')
>>> self.log.comment('Providing useful advice just for you')
>>> self.log.command('yum update sssd -y')
@@ -55,6 +55,11 @@ As you can see, Advice's log has 3 different levels. Debug lines are printed
out with '# DEBUG:' prefix if --verbose had been used. Comment lines utilize
'# ' prefix and command lines are printed raw.
+Please note that comments are automatically wrapped after 70 characters.
+Use wrapped=False option to force the unwrapped line in the comment.
+
+>>> self.log.comment("This line should not be wrapped", wrapped=False)
+
As a result, you can redirect the advice's output directly to a script file.
# ipa-advise sample-advice > script.sh