Update Copyright header point to COPYING file
[cascardo/ipsilon.git] / ipsilon / providers / saml2 / admin.py
index 158e590..28ea19f 100644 (file)
@@ -1,19 +1,4 @@
-# Copyright (C) 2014  Simo Sorce <simo@redhat.com>
-#
-# see file 'COPYING' for use and warranty information
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# Copyright (C) 2014 Ipsilon project Contributors, for license see COPYING
 
 import cherrypy
 from ipsilon.util import config as pconfig
@@ -157,6 +142,9 @@ class SPAdminPage(AdminPage):
                 value = kwargs[name]
                 if isinstance(option, pconfig.List):
                     value = [x.strip() for x in value.split('\n')]
+                    # for normal lists we want unordered comparison
+                    if set(value) == set(option.get_value()):
+                        continue
                 elif isinstance(option, pconfig.Condition):
                     value = True
             else:
@@ -168,9 +156,9 @@ class SPAdminPage(AdminPage):
                         aname = '%s_%s' % (name, a)
                         if aname in kwargs:
                             value.append(a)
-                elif type(option) is pconfig.ComplexList:
+                elif isinstance(option, pconfig.MappingList):
                     current = deepcopy(option.get_value())
-                    value = get_complex_list_value(name,
+                    value = get_mapping_list_value(name,
                                                    current,
                                                    **kwargs)
                     # if current value is None do nothing
@@ -178,9 +166,9 @@ class SPAdminPage(AdminPage):
                         if option.get_value() is None:
                             continue
                         # else pass and let it continue as None
-                elif type(option) is pconfig.MappingList:
+                elif isinstance(option, pconfig.ComplexList):
                     current = deepcopy(option.get_value())
-                    value = get_mapping_list_value(name,
+                    value = get_complex_list_value(name,
                                                    current,
                                                    **kwargs)
                     # if current value is None do nothing
@@ -192,9 +180,6 @@ class SPAdminPage(AdminPage):
                     continue
 
             if value != option.get_value():
-                if (type(option) is pconfig.List and
-                        set(value) == set(option.get_value())):
-                    continue
                 cherrypy.log.error("Storing %s = %s" %
                                    (name, value), severity=logging.DEBUG)
                 new_db_values[name] = value