fix at dbmemory set_list 33/8733/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 30 Mar 2020 08:56:15 +0000 (08:56 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 30 Mar 2020 08:56:15 +0000 (08:56 +0000)
Change-Id: Ia3bff987378f5fdaac05b56701fb6326a6cb1105
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_common/dbmemory.py

index 0c720e1..d3b4019 100644 (file)
@@ -372,7 +372,7 @@ class DbMemory(DbBase):
                     raise DbException("Not found entry with _id='{}'".format(q_filter), HTTPStatus.NOT_FOUND)
                 return None
 
-    def set_list(self, table, q_filter, update_dict, fail_on_empty=True, unset=None, pull=None, push=None):
+    def set_list(self, table, q_filter, update_dict, unset=None, pull=None, push=None):
         with self.lock:
             updated = 0
             found = 0
@@ -380,8 +380,8 @@ class DbMemory(DbBase):
                 found += 1
                 if self._update(db_item, update_dict, unset=unset, pull=pull, push=push):
                     updated += 1
-            if not found and fail_on_empty:
-                raise DbException("Not found entry with '{}'".format(q_filter), HTTPStatus.NOT_FOUND)
+            if not found and fail_on_empty:
+                raise DbException("Not found entry with '{}'".format(q_filter), HTTPStatus.NOT_FOUND)
             return {"updated": updated} if found else None
 
     def replace(self, table, _id, indata, fail_on_empty=True):