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 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): """ 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')