diff options
author | Tomas Babej <tbabej@redhat.com> | 2014-06-19 12:47:46 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2014-06-25 21:07:07 +0200 |
commit | 2a3c746dca43050076b217a52caa5bb2d1e40d6e (patch) | |
tree | 7d44556b8f52079c308535c2eabbe8508117cc53 /ipaplatform/fedora | |
parent | e099ad458335fbc4b4c0092fc94f6155064e964f (diff) | |
download | freeipa-2a3c746dca43050076b217a52caa5bb2d1e40d6e.tar.gz freeipa-2a3c746dca43050076b217a52caa5bb2d1e40d6e.tar.xz freeipa-2a3c746dca43050076b217a52caa5bb2d1e40d6e.zip |
ipaplatform: Drop the base authconfig class
As authconfig is a distro-specific tool there is no incentive for
implying that other platforms should implement any authconfig
implementation of their own.
Part of: https://fedorahosted.org/freeipa/ticket/4052
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipaplatform/fedora')
-rw-r--r-- | ipaplatform/fedora/authconfig.py | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/ipaplatform/fedora/authconfig.py b/ipaplatform/fedora/authconfig.py index 166a826f7..524d76929 100644 --- a/ipaplatform/fedora/authconfig.py +++ b/ipaplatform/fedora/authconfig.py @@ -19,16 +19,46 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from ipapython import ipautil -from ipaplatform.base.authconfig import AuthConfig -class FedoraAuthConfig(AuthConfig): +class FedoraAuthConfig(object): """ AuthConfig class implements system-independent interface to configure - system authentication resources. In Red Hat-produced systems this is done - with authconfig(8) utility. + system authentication resources. In Red Hat systems this is done with + authconfig(8) utility. + + AuthConfig class is nothing more than a tool to gather configuration + options and execute their processing. These options then converted by + an actual implementation to series of a system calls to appropriate + utilities performing real configuration. + + If you need to re-use existing AuthConfig instance for multiple runs, + make sure to call 'AuthConfig.reset()' between the runs. """ + def __init__(self): + self.parameters = {} + + def enable(self, option): + self.parameters[option] = True + return self + + def disable(self, option): + self.parameters[option] = False + return self + + def add_option(self, option): + self.parameters[option] = None + return self + + def add_parameter(self, option, value): + self.parameters[option] = [value] + return self + + def reset(self): + self.parameters = {} + return self + def build_args(self): args = [] |