diff --git a/gbpservice/neutron/tests/unit/nfp/orchestrator/modules/test_service_orchestrator.py b/gbpservice/neutron/tests/unit/nfp/orchestrator/modules/test_service_orchestrator.py index 4e7251c10..3748efd78 100644 --- a/gbpservice/neutron/tests/unit/nfp/orchestrator/modules/test_service_orchestrator.py +++ b/gbpservice/neutron/tests/unit/nfp/orchestrator/modules/test_service_orchestrator.py @@ -236,6 +236,8 @@ class ServiceOrchestratorTestCase(NSOModuleTestCase): self.assertIsNotNone(network_function) db_network_function = self.nfp_db.get_network_function( self.session, network_function['id']) + service_config = db_network_function.pop('service_config') + self.assertIsNone(service_config) self.assertEqual(network_function, db_network_function) def test_validate_create_service_input(self): diff --git a/gbpservice/nfp/common/constants.py b/gbpservice/nfp/common/constants.py index 75298a611..1bacdd2c7 100644 --- a/gbpservice/nfp/common/constants.py +++ b/gbpservice/nfp/common/constants.py @@ -116,5 +116,8 @@ CHECK_USER_CONFIG_COMPLETE_MAXRETRY = 20 PULL_NOTIFICATIONS_SPACING = 10 #nfp_node_deriver_config -SERVICE_CREATE_TIMEOUT = 600 +SERVICE_CREATE_TIMEOUT = 900 SERVICE_DELETE_TIMEOUT = 300 + +# heat stack creation timeout +STACK_ACTION_WAIT_TIME = 300 diff --git a/gbpservice/nfp/core/controller.py b/gbpservice/nfp/core/controller.py index 794eaa06f..2939f781d 100644 --- a/gbpservice/nfp/core/controller.py +++ b/gbpservice/nfp/core/controller.py @@ -242,8 +242,13 @@ class NfpController(nfp_launcher.NfpLauncher, NfpService): return event def pipe_send(self, pipe, event): - self.compress(event) - pipe.send(event) + try: + self.compress(event) + pipe.send(event) + except Exception as e: + message = "Failed to send data via pipe, Reason: %s" % e + LOG.error(message) + raise e def _fork(self, args): proc = PROCESS(target=self.child, args=args) diff --git a/gbpservice/nfp/orchestrator/config_drivers/heat_driver.py b/gbpservice/nfp/orchestrator/config_drivers/heat_driver.py index e5f671db5..6fb347b4e 100644 --- a/gbpservice/nfp/orchestrator/config_drivers/heat_driver.py +++ b/gbpservice/nfp/orchestrator/config_drivers/heat_driver.py @@ -54,7 +54,7 @@ HEAT_DRIVER_OPTS = [ help=_("Heat API server address to instantiate services " "specified in the service chain.")), cfg.IntOpt('stack_action_wait_time', - default=120, + default=nfp_constants.STACK_ACTION_WAIT_TIME, help=_("Seconds to wait for pending stack operation " "to complete")), cfg.BoolOpt('is_service_admin_owned', diff --git a/gbpservice/nfp/orchestrator/modules/service_orchestrator.py b/gbpservice/nfp/orchestrator/modules/service_orchestrator.py index 608152161..a2d5d71fc 100644 --- a/gbpservice/nfp/orchestrator/modules/service_orchestrator.py +++ b/gbpservice/nfp/orchestrator/modules/service_orchestrator.py @@ -763,7 +763,7 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler): 'service_chain_node']['name'][:6], network_function_info[ 'service_chain_instance']['name'][:6]) - service_config_str = network_function_info.get('service_config') + service_config_str = network_function_info.pop('service_config') network_function = { 'name': name, 'description': '', @@ -776,6 +776,7 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler): } network_function = self.db_handler.create_network_function( self.db_session, network_function) + network_function.pop('service_config') nfp_logging.store_logging_context( meta_id=network_function['id'], @@ -842,6 +843,9 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler): auth_token=context.auth_token) network_function_details = self.get_network_function_details( network_function_id) + service_config = ( + network_function_details['network_function'].pop( + 'service_config')) service_profile_id = network_function_details[ 'network_function']['service_profile_id'] base_mode_support, resource_data = ( @@ -886,7 +890,6 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler): binding_key=network_function_id)) GRAPH[dnf_event].append(ducf_event) else: - service_config = network_function['service_config'] self.delete_network_function_user_config(network_function_id, service_config) if not base_mode_support: @@ -1052,8 +1055,8 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler): network_function_instance['status'] = nfp_constants.ACTIVE network_function_instance[ 'network_function_device_id'] = network_function_device['id'] - - service_config = network_function['service_config'] + # get service_config from nf + service_config = nfp_context['service_chain_node'].get('config') nfp_context['event_desc'] = event.desc.to_dict() nfp_context['key'] = event.key nfp_context['id'] = event.id