diff options
author | Simo Sorce <simo@redhat.com> | 2014-10-15 20:04:14 -0400 |
---|---|---|
committer | Patrick Uiterwijk <puiterwijk@redhat.com> | 2014-10-27 16:31:38 +0100 |
commit | 3a81575a4625576895958c9a21c8b6c64307fcb9 (patch) | |
tree | 08c400999033089c404f6477e27d499cb8e75b32 /ipsilon/login | |
parent | fb1c34e7aeac67a75c29a132ded87edeb557cdaf (diff) | |
download | ipsilon-3a81575a4625576895958c9a21c8b6c64307fcb9.tar.gz ipsilon-3a81575a4625576895958c9a21c8b6c64307fcb9.tar.xz ipsilon-3a81575a4625576895958c9a21c8b6c64307fcb9.zip |
Reuse the AdminPlugins class for the providers too
This way we can remove even more duplicated code... \o/
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/login')
-rwxr-xr-x | ipsilon/login/common.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ipsilon/login/common.py b/ipsilon/login/common.py index 6cd1ca8..73422ae 100755 --- a/ipsilon/login/common.py +++ b/ipsilon/login/common.py @@ -34,6 +34,7 @@ class LoginManagerBase(PluginObject, Log): def __init__(self): super(LoginManagerBase, self).__init__() + self._site = None self.path = '/' self.next_login = None self.info = None @@ -115,7 +116,14 @@ class LoginManagerBase(PluginObject, Log): def get_tree(self, site): raise NotImplementedError + @property + def is_enabled(self): + if self._site: + return self in self._site[FACILITY]['enabled'] + return False + def enable(self, site): + self._site = site plugins = site[FACILITY] if self in plugins['enabled']: return @@ -147,6 +155,7 @@ class LoginManagerBase(PluginObject, Log): self.info = root.info def disable(self, site): + self._site = site plugins = site[FACILITY] if self not in plugins['enabled']: return |