From 8321e17500ff882e9fc57e166f518618b1448142 Mon Sep 17 00:00:00 2001
From: Dimitrios Markou <mardim@intracom-telecom.com>
Date: Mon, 18 Sep 2017 12:39:18 +0300
Subject: [Bug Fix] Delete vnffgs in a reverse order

JIRA: SFC-106

In sfc_two_chain testcase we need to delete first the blue
and then the red vnffg because if we do it the other way around
the tacker produces a warning that the flow classifier of the vnffg red
is in use and cannot delete the chain.

The aforementioned warning is produced because during the execution
of the two_chain testcase we reassing the classifier from the red vnffg
to the blue vnffg. So if we try to delete first the red vnffg we get the
warning because the classifier is assigned and in use from the blue
vnffg.

Change-Id: I3cb7bef4b9b9e75eef4961fe7f63cbc1755130be
Signed-off-by: Dimitrios Markou <mardim@intracom-telecom.com>
---
 sfc/lib/cleanup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sfc/lib/cleanup.py b/sfc/lib/cleanup.py
index 7936600b..a5512c66 100644
--- a/sfc/lib/cleanup.py
+++ b/sfc/lib/cleanup.py
@@ -49,7 +49,7 @@ def delete_vnffgs():
     vnffgs = os_tacker.list_vnffgs(t)
     if vnffgs is None:
         return
-    for vnffg in vnffgs:
+    for vnffg in reversed(vnffgs):
         logger.info("Removing vnffg: {0}".format(vnffg))
         os_tacker.delete_vnffg(t, vnffg_id=vnffg)
 
-- 
cgit