From 51f7862f62b032878c2c7784fcaa52deee0c8742 Mon Sep 17 00:00:00 2001 From: Andrew Bays Date: Wed, 31 Aug 2016 10:33:11 -0400 Subject: [PATCH] Improve create_network_and_subnets method error/success detection --- .../__methods__/create_networks_and_subnets.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/OPNFV/NetworkServices/Methods.class/__methods__/create_networks_and_subnets.rb b/scripts/OPNFV/NetworkServices/Methods.class/__methods__/create_networks_and_subnets.rb index 030b310..c1c8c56 100644 --- a/scripts/OPNFV/NetworkServices/Methods.class/__methods__/create_networks_and_subnets.rb +++ b/scripts/OPNFV/NetworkServices/Methods.class/__methods__/create_networks_and_subnets.rb @@ -60,8 +60,20 @@ def deploy_networks(network_service, parent_service) networks_template = get_networks_template(network_service, parent_service) networks_orchestration = deploy_networks_stack(network_orchestration_manager, parent_service, networks_template) end + + if networks_orchestration == nil + $evm.log(:warn, "Network orchestration service still missing for #{parent_service.name} networks") + $evm.root['ae_result'] = 'retry' + $evm.root['ae_retry_interval'] = '5.seconds' + exit MIQ_OK + end - if networks_orchestration.orchestration_stack_status[0] == 'transient' + if networks_orchestration.orchestration_stack_status[0].include? 'rollback' + $evm.log(:error, "Stack for #{parent_service.name} networks failed") + exit MIQ_ERROR + end + + if networks_orchestration.orchestration_stack_status[0] != 'create_complete' $evm.log(:info, "Waiting for networks to spawn: #{networks_orchestration.orchestration_stack_status} (current state)") $evm.root['ae_result'] = 'retry' $evm.root['ae_retry_interval'] = '5.seconds'