In configure we do not need to set_config()
authorSimo Sorce <simo@redhat.com>
Mon, 20 Oct 2014 20:08:06 +0000 (16:08 -0400)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Wed, 12 Nov 2014 22:46:57 +0000 (23:46 +0100)
All we care about in configure is to store the config in the db,
so skip setting the config explicitly in the plugin object and go
straight to the database.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/info/infoldap.py
ipsilon/info/nss.py
ipsilon/login/authfas.py
ipsilon/login/authform.py
ipsilon/login/authkrb.py
ipsilon/login/authldap.py
ipsilon/login/authpam.py
ipsilon/login/authtest.py
ipsilon/providers/openidp.py
ipsilon/providers/saml2idp.py

index 0b94fac..70d36d5 100755 (executable)
@@ -198,8 +198,7 @@ class Installer(InfoProviderInstaller):
         elif 'ldap_bind_dn_template' in opts:
             config['user dn template'] = opts['ldap_bind_dn_template']
         config['tls'] = 'Demand'
         elif 'ldap_bind_dn_template' in opts:
             config['user dn template'] = opts['ldap_bind_dn_template']
         config['tls'] = 'Demand'
-        po.set_config(config)
-        po.save_plugin_config(self.facility)
+        po.save_plugin_config(self.facility, config)
 
         # Replace global config, only one plugin info can be used
         po.name = 'global'
 
         # Replace global config, only one plugin info can be used
         po.name = 'global'
@@ -210,5 +209,4 @@ class Installer(InfoProviderInstaller):
             order = []
         order.append('ldap')
         globalconf['order'] = ','.join(order)
             order = []
         order.append('ldap')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(self.facility)
+        po.save_plugin_config(self.facility, globalconf)
index 4208442..24f3522 100755 (executable)
@@ -101,5 +101,4 @@ class Installer(InfoProviderInstaller):
             order = []
         order.append('nss')
         globalconf['order'] = ','.join(order)
             order = []
         order.append('nss')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(self.facility)
+        po.save_plugin_config(self.facility, globalconf)
index 2759626..c2d8fff 100755 (executable)
@@ -211,5 +211,4 @@ class Installer(object):
             order = []
         order.append('fas')
         globalconf['order'] = ','.join(order)
             order = []
         order.append('fas')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, globalconf)
index 9c20cf5..418a5e5 100755 (executable)
@@ -144,8 +144,7 @@ class Installer(object):
             order = []
         order.append('form')
         globalconf['order'] = ','.join(order)
             order = []
         order.append('form')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, globalconf)
 
         # for selinux enabled platforms, ignore if it fails just report
         try:
 
         # for selinux enabled platforms, ignore if it fails just report
         try:
index 724c2ce..6c561ac 100755 (executable)
@@ -164,5 +164,4 @@ class Installer(object):
             order = []
         order.insert(0, 'krb')
         globalconf['order'] = ','.join(order)
             order = []
         order.insert(0, 'krb')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, globalconf)
index a41d167..ed75e91 100755 (executable)
@@ -212,8 +212,7 @@ class Installer(object):
         if 'ldap_bind_dn_template' in opts:
             config['bind dn template'] = opts['ldap_bind_dn_template']
         config['tls'] = 'Demand'
         if 'ldap_bind_dn_template' in opts:
             config['bind dn template'] = opts['ldap_bind_dn_template']
         config['tls'] = 'Demand'
-        po.set_config(config)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, config)
 
         # Update global config to add login plugin
         po = PluginObject()
 
         # Update global config to add login plugin
         po = PluginObject()
@@ -225,5 +224,4 @@ class Installer(object):
             order = []
         order.append('ldap')
         globalconf['order'] = ','.join(order)
             order = []
         order.append('ldap')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, globalconf)
index 35edbaf..10b550e 100755 (executable)
@@ -145,8 +145,7 @@ class Installer(object):
 
         po.wipe_config_values(FACILITY)
         config = {'service name': opts['pam_service']}
 
         po.wipe_config_values(FACILITY)
         config = {'service name': opts['pam_service']}
-        po.set_config(config)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, config)
 
         # Update global config to add login plugin
         po = PluginObject()
 
         # Update global config to add login plugin
         po = PluginObject()
@@ -158,8 +157,7 @@ class Installer(object):
             order = []
         order.append('pam')
         globalconf['order'] = ','.join(order)
             order = []
         order.append('pam')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, globalconf)
 
         # for selinux enabled platforms, ignore if it fails just report
         try:
 
         # for selinux enabled platforms, ignore if it fails just report
         try:
index 44492a4..6288826 100755 (executable)
@@ -127,5 +127,4 @@ class Installer(object):
             order = []
         order.append('testauth')
         globalconf['order'] = ','.join(order)
             order = []
         order.append('testauth')
         globalconf['order'] = ','.join(order)
-        po.set_config(globalconf)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, globalconf)
index a3e1b63..5abdcad 100755 (executable)
@@ -148,5 +148,4 @@ class Installer(object):
         config = {'endpoint url': url,
                   'identity_url_template': '%sid/%%(username)s' % url,
                   'enabled': '1'}
         config = {'endpoint url': url,
                   'identity_url_template': '%sid/%%(username)s' % url,
                   'enabled': '1'}
-        po.set_config(config)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, config)
index 7508760..cb2c4a2 100755 (executable)
@@ -307,8 +307,7 @@ class Installer(object):
                   'idp certificate file': cert.cert,
                   'idp key file': cert.key,
                   'enabled': '1'}
                   'idp certificate file': cert.cert,
                   'idp key file': cert.key,
                   'enabled': '1'}
-        po.set_config(config)
-        po.save_plugin_config(FACILITY)
+        po.save_plugin_config(FACILITY, config)
 
         # Fixup permissions so only the ipsilon user can read these files
         files.fix_user_dirs(path, opts['system_user'])
 
         # Fixup permissions so only the ipsilon user can read these files
         files.fix_user_dirs(path, opts['system_user'])