server/sources/__init__.py
changeset 8696 0bb18407c053
parent 8695 358d8bed9626
child 8892 80783605d270
equal deleted inserted replaced
8695:358d8bed9626 8696:0bb18407c053
   185         try:
   185         try:
   186             processed['adapter'] = confdict['adapter']
   186             processed['adapter'] = confdict['adapter']
   187         except KeyError:
   187         except KeyError:
   188             pass
   188             pass
   189         # check for unknown options
   189         # check for unknown options
   190         if confdict and not confdict.keys() == ['adapter']:
   190         if confdict and tuple(confdict) != ('adapter',):
   191             if fail_if_unknown:
   191             if fail_if_unknown:
   192                 msg = _('unknown options %s') % ', '.join(confdict)
   192                 msg = _('unknown options %s') % ', '.join(confdict)
   193                 raise ValidationError(eid, {role_name('config', 'subject'): msg})
   193                 raise ValidationError(eid, {role_name('config', 'subject'): msg})
   194             else:
   194             else:
   195                 logger = getLogger('cubicweb.sources')
   195                 logger = getLogger('cubicweb.sources')
   240     PUBLIC_KEYS = ('type', 'uri', 'use-cwuri-as-url')
   240     PUBLIC_KEYS = ('type', 'uri', 'use-cwuri-as-url')
   241     def remove_sensitive_information(self, sourcedef):
   241     def remove_sensitive_information(self, sourcedef):
   242         """remove sensitive information such as login / password from source
   242         """remove sensitive information such as login / password from source
   243         definition
   243         definition
   244         """
   244         """
   245         for key in sourcedef.keys():
   245         for key in list(sourcedef):
   246             if not key in self.PUBLIC_KEYS:
   246             if not key in self.PUBLIC_KEYS:
   247                 sourcedef.pop(key)
   247                 sourcedef.pop(key)
   248 
   248 
   249     # connections handling #####################################################
   249     # connections handling #####################################################
   250 
   250