summaryrefslogtreecommitdiffstats
path: root/ipsilon/login/authfas.py
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-10-27 11:25:46 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2014-11-12 23:47:25 +0100
commitb7b80c5c0fc1895e85aae3acbfcbbc593a42697f (patch)
tree530512524a374059a9648ace99c56146af95bf4d /ipsilon/login/authfas.py
parentc6b167fcf290c415b8d1903237fb5405b7213405 (diff)
downloadipsilon-b7b80c5c0fc1895e85aae3acbfcbbc593a42697f.tar.gz
ipsilon-b7b80c5c0fc1895e85aae3acbfcbbc593a42697f.tar.xz
ipsilon-b7b80c5c0fc1895e85aae3acbfcbbc593a42697f.zip
Refactor plugin initialization and enablement
Move most plugin enablement and initialization code in plugin.py to reduce code duplication and simplify and unifify plugin enablement for all base plugin types (login, info, providers). This patch breaks backwards compatibility as it changes how the list of enabled plugins is stored in the database tables. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Diffstat (limited to 'ipsilon/login/authfas.py')
-rwxr-xr-xipsilon/login/authfas.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/ipsilon/login/authfas.py b/ipsilon/login/authfas.py
index 71db372..cb1c324 100755
--- a/ipsilon/login/authfas.py
+++ b/ipsilon/login/authfas.py
@@ -5,7 +5,6 @@
from ipsilon.info.common import InfoMapping
from ipsilon.login.common import LoginFormBase, LoginManagerBase
-from ipsilon.login.common import FACILITY
from ipsilon.util.plugin import PluginObject
from ipsilon.util import config as pconfig
import cherrypy
@@ -175,9 +174,10 @@ Form based login Manager that uses the Fedora Authentication Server
class Installer(object):
- def __init__(self):
+ def __init__(self, *pargs):
self.name = 'fas'
self.ptype = 'login'
+ self.pargs = pargs
def install_args(self, group):
group.add_argument('--fas', choices=['yes', 'no'], default='no',
@@ -188,20 +188,11 @@ class Installer(object):
return
# Add configuration data to database
- po = PluginObject()
+ po = PluginObject(*self.pargs)
po.name = 'fas'
po.wipe_data()
-
- po.wipe_config_values(FACILITY)
+ po.wipe_config_values()
# Update global config to add login plugin
- po = PluginObject()
- po.name = 'global'
- globalconf = po.get_plugin_config(FACILITY)
- if 'order' in globalconf:
- order = globalconf['order'].split(',')
- else:
- order = []
- order.append('fas')
- globalconf['order'] = ','.join(order)
- po.save_plugin_config(FACILITY, globalconf)
+ po.is_enabled = True
+ po.save_enabled_state()