Execute all CVP tasks one by one 09/8809/2
authorS237035 <oscarluis.peral@atos.net>
Tue, 21 Apr 2020 14:56:07 +0000 (16:56 +0200)
committerS237035 <oscarluis.peral@atos.net>
Mon, 27 Apr 2020 09:40:20 +0000 (11:40 +0200)
Change-Id: Ib9fd24eadf4f6342c75cf4bb9b8df0ff24aa6962
Signed-off-by: S237035 <oscarluis.peral@atos.net>
RO-SDN-arista/osm_rosdn_arista/wimconn_arista.py

index 5c28867..3621b0f 100644 (file)
@@ -763,7 +763,6 @@ class AristaSdnConnector(SdnConnectorBase):
             for s in self.s_api:
                 allLeafConfigured[s] = False
                 allLeafModified[s] = False
-            tasks = dict()
             cl_toDelete = []
             for s in self.s_api:
                 toDelete_in_cvp = False
@@ -801,7 +800,6 @@ class AristaSdnConnector(SdnConnectorBase):
                 self.logger.info("Device {} modify result {}".format(s, res))
                 for t_id in res[1]['tasks']:
                     if not toDelete_in_cvp:
-                        tasks[t_id] = {'workOrderId': t_id}
                         note_msg = "{}{}{}{}##".format(self.__MANAGED_BY_OSM,
                                                        self.__SEPARATOR,
                                                        t_id,
@@ -810,15 +808,12 @@ class AristaSdnConnector(SdnConnectorBase):
                                 cls_perSw[s][0]['key'],
                                 note_msg)
                         cls_perSw[s][0]['note'] = note_msg
-                    else:
-                        delete_tasks = { t_id : {'workOrderId': t_id} }
-                        self.__exec_task(delete_tasks)
+                    tasks = { t_id : {'workOrderId': t_id} }
+                    self.__exec_task(tasks, self.__EXC_TASK_EXEC_WAIT)
                 # with just one configLet assigned to a device,
                 # delete all if there are errors in next loops
                 if not toDelete_in_cvp:
                     allLeafModified[s] = True
-            if len(tasks) > 0:
-                self.__exec_task(tasks, self.__EXC_TASK_EXEC_WAIT)
             if len(cl_toDelete) > 0:
                 self.__configlet_modify(cl_toDelete, delete=True)