def list(self, context, search_opts):
        so = {}
        for key in ('limit', 'offset'):
            if key in search_opts:
                so[key] = search_opts.pop(key)

        if search_opts:
            so['filters'] = search_opts

        return db.resource_find(so)
 def run(self):
     while self._running:
         resources = db.resource_find(
             {'filters': {'processing': False,
                          'status': base.STATE_DELETED}}
         )
         for resource in resources:
             LOG.debug(_('Delete resource %s'), resource['id'])
             db.resource_delete(resource['id'])
         eventlet.sleep(CONF.sleep_time)
 def test_find(self):
     args = [{}]
     db.resource_find(*args)
     self.mock.resource_find.assert_with_call(args)