diff options
author | Jan Cholasta <jcholast@redhat.com> | 2015-02-16 16:34:01 +0000 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2015-03-05 11:01:36 +0100 |
commit | 2625efa727822addbaa469dbf5c680b0f62c43da (patch) | |
tree | 4b2793e9ba7a03838c6aa12630dc1ce66a757ddc /ipalib/frontend.py | |
parent | dae6a1881354e57b58c79ffea0a75f524286855e (diff) | |
download | freeipa-2625efa727822addbaa469dbf5c680b0f62c43da.tar.gz freeipa-2625efa727822addbaa469dbf5c680b0f62c43da.tar.xz freeipa-2625efa727822addbaa469dbf5c680b0f62c43da.zip |
advise: Add separate API object for ipa-advise
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r-- | ipalib/frontend.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py index e82a03a2a..36d9ab2d4 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -1406,53 +1406,3 @@ class Updater(Method): ) return self.execute(**options) - - -class _AdviceOutput(object): - - def __init__(self): - self.content = [] - self.prefix = '# ' - self.options = None - - def comment(self, line, wrapped=True): - if wrapped: - for wrapped_line in wrap(line, 70): - self.content.append(self.prefix + wrapped_line) - else: - self.content.append(self.prefix + line) - - def debug(self, line): - if self.options.verbose: - self.comment('DEBUG: ' + line) - - def command(self, line): - self.content.append(line) - - -@register.base() -class Advice(Plugin): - """ - Base class for advices, plugins for ipa-advise. - """ - - options = None - require_root = False - description = '' - - def __init__(self): - super(Advice, self).__init__() - self.log = _AdviceOutput() - - def set_options(self, options): - self.options = options - self.log.options = options - - def get_info(self): - """ - This method should be overriden by child Advices. - - Returns a string with instructions. - """ - - raise NotImplementedError |