From 3e9ef233537f2d08d5af58550c2ce39f13a3f84e Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 3 Oct 2018 13:20:07 +0200 Subject: [PATCH 1/3] Stop ctxt processes before destroying VMs --- IM/InfrastructureManager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IM/InfrastructureManager.py b/IM/InfrastructureManager.py index ca40a40c2..b30ba106a 100644 --- a/IM/InfrastructureManager.py +++ b/IM/InfrastructureManager.py @@ -1111,6 +1111,8 @@ def DestroyInfrastructure(inf_id, auth): sel_inf = InfrastructureManager.get_infrastructure(inf_id, auth) delete_list = list(reversed(sel_inf.get_vm_list())) + # First stop ctxt processes + sel_inf.stop() # Destroy the Infrastructure sel_inf.destroy(auth, delete_list) # Set the Infrastructure as deleted From b5abe2a49f7d5b7aafca985ac0cb6a01c256039e Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 3 Oct 2018 13:20:24 +0200 Subject: [PATCH 2/3] Solve WN issues --- IM/tosca/Tosca.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/IM/tosca/Tosca.py b/IM/tosca/Tosca.py index fde708ae8..218a2ddf6 100644 --- a/IM/tosca/Tosca.py +++ b/IM/tosca/Tosca.py @@ -225,7 +225,16 @@ def _order_deploys(self, radl): else: priv.append(d) - radl.deploys = pub + priv + # This is patch, we need a solution for that + wn = [] + fe = [] + for d in pub: + if "wn" in d.id: + wn.append(d) + else: + fe.append(d) + + radl.deploys = fe + wn + priv def _get_num_instances(self, sys_name, inf_info): """ From 2499e41bcb753ed63241beb1bcdc57a3c20bf16a Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 3 Oct 2018 13:21:00 +0200 Subject: [PATCH 3/3] Improve test --- test/unit/Tosca.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/Tosca.py b/test/unit/Tosca.py index 643eba9ee..b4b97d441 100755 --- a/test/unit/Tosca.py +++ b/test/unit/Tosca.py @@ -80,6 +80,8 @@ def test_tosca_to_radl(self): self.assertEqual(lrms_wn.getValue("spot"), 'no') self.assertEqual(lrms_wn.getValue("instance_type"), 'some_type') + self.assertEqual([d.id for d in radl.deploys], ['other_server', 'lrms_server', 'lrms_wn']) + def test_tosca_get_outputs(self): """Test TOSCA get_outputs function""" tosca_data = read_file_as_string('../files/tosca_create.yml')