Merge "NFP - Added support for user config with big data"
This commit is contained in:
@@ -236,6 +236,8 @@ class ServiceOrchestratorTestCase(NSOModuleTestCase):
|
|||||||
self.assertIsNotNone(network_function)
|
self.assertIsNotNone(network_function)
|
||||||
db_network_function = self.nfp_db.get_network_function(
|
db_network_function = self.nfp_db.get_network_function(
|
||||||
self.session, network_function['id'])
|
self.session, network_function['id'])
|
||||||
|
service_config = db_network_function.pop('service_config')
|
||||||
|
self.assertIsNone(service_config)
|
||||||
self.assertEqual(network_function, db_network_function)
|
self.assertEqual(network_function, db_network_function)
|
||||||
|
|
||||||
def test_validate_create_service_input(self):
|
def test_validate_create_service_input(self):
|
||||||
|
|||||||
@@ -116,5 +116,8 @@ CHECK_USER_CONFIG_COMPLETE_MAXRETRY = 20
|
|||||||
PULL_NOTIFICATIONS_SPACING = 10
|
PULL_NOTIFICATIONS_SPACING = 10
|
||||||
|
|
||||||
#nfp_node_deriver_config
|
#nfp_node_deriver_config
|
||||||
SERVICE_CREATE_TIMEOUT = 600
|
SERVICE_CREATE_TIMEOUT = 900
|
||||||
SERVICE_DELETE_TIMEOUT = 300
|
SERVICE_DELETE_TIMEOUT = 300
|
||||||
|
|
||||||
|
# heat stack creation timeout
|
||||||
|
STACK_ACTION_WAIT_TIME = 300
|
||||||
|
|||||||
@@ -242,8 +242,13 @@ class NfpController(nfp_launcher.NfpLauncher, NfpService):
|
|||||||
return event
|
return event
|
||||||
|
|
||||||
def pipe_send(self, pipe, event):
|
def pipe_send(self, pipe, event):
|
||||||
|
try:
|
||||||
self.compress(event)
|
self.compress(event)
|
||||||
pipe.send(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):
|
def _fork(self, args):
|
||||||
proc = PROCESS(target=self.child, args=args)
|
proc = PROCESS(target=self.child, args=args)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ HEAT_DRIVER_OPTS = [
|
|||||||
help=_("Heat API server address to instantiate services "
|
help=_("Heat API server address to instantiate services "
|
||||||
"specified in the service chain.")),
|
"specified in the service chain.")),
|
||||||
cfg.IntOpt('stack_action_wait_time',
|
cfg.IntOpt('stack_action_wait_time',
|
||||||
default=120,
|
default=nfp_constants.STACK_ACTION_WAIT_TIME,
|
||||||
help=_("Seconds to wait for pending stack operation "
|
help=_("Seconds to wait for pending stack operation "
|
||||||
"to complete")),
|
"to complete")),
|
||||||
cfg.BoolOpt('is_service_admin_owned',
|
cfg.BoolOpt('is_service_admin_owned',
|
||||||
|
|||||||
@@ -763,7 +763,7 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler):
|
|||||||
'service_chain_node']['name'][:6],
|
'service_chain_node']['name'][:6],
|
||||||
network_function_info[
|
network_function_info[
|
||||||
'service_chain_instance']['name'][:6])
|
'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 = {
|
network_function = {
|
||||||
'name': name,
|
'name': name,
|
||||||
'description': '',
|
'description': '',
|
||||||
@@ -776,6 +776,7 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler):
|
|||||||
}
|
}
|
||||||
network_function = self.db_handler.create_network_function(
|
network_function = self.db_handler.create_network_function(
|
||||||
self.db_session, network_function)
|
self.db_session, network_function)
|
||||||
|
network_function.pop('service_config')
|
||||||
|
|
||||||
nfp_logging.store_logging_context(
|
nfp_logging.store_logging_context(
|
||||||
meta_id=network_function['id'],
|
meta_id=network_function['id'],
|
||||||
@@ -842,6 +843,9 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler):
|
|||||||
auth_token=context.auth_token)
|
auth_token=context.auth_token)
|
||||||
network_function_details = self.get_network_function_details(
|
network_function_details = self.get_network_function_details(
|
||||||
network_function_id)
|
network_function_id)
|
||||||
|
service_config = (
|
||||||
|
network_function_details['network_function'].pop(
|
||||||
|
'service_config'))
|
||||||
service_profile_id = network_function_details[
|
service_profile_id = network_function_details[
|
||||||
'network_function']['service_profile_id']
|
'network_function']['service_profile_id']
|
||||||
base_mode_support, resource_data = (
|
base_mode_support, resource_data = (
|
||||||
@@ -886,7 +890,6 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler):
|
|||||||
binding_key=network_function_id))
|
binding_key=network_function_id))
|
||||||
GRAPH[dnf_event].append(ducf_event)
|
GRAPH[dnf_event].append(ducf_event)
|
||||||
else:
|
else:
|
||||||
service_config = network_function['service_config']
|
|
||||||
self.delete_network_function_user_config(network_function_id,
|
self.delete_network_function_user_config(network_function_id,
|
||||||
service_config)
|
service_config)
|
||||||
if not base_mode_support:
|
if not base_mode_support:
|
||||||
@@ -1052,8 +1055,8 @@ class ServiceOrchestrator(nfp_api.NfpEventHandler):
|
|||||||
network_function_instance['status'] = nfp_constants.ACTIVE
|
network_function_instance['status'] = nfp_constants.ACTIVE
|
||||||
network_function_instance[
|
network_function_instance[
|
||||||
'network_function_device_id'] = network_function_device['id']
|
'network_function_device_id'] = network_function_device['id']
|
||||||
|
# get service_config from nf
|
||||||
service_config = network_function['service_config']
|
service_config = nfp_context['service_chain_node'].get('config')
|
||||||
nfp_context['event_desc'] = event.desc.to_dict()
|
nfp_context['event_desc'] = event.desc.to_dict()
|
||||||
nfp_context['key'] = event.key
|
nfp_context['key'] = event.key
|
||||||
nfp_context['id'] = event.id
|
nfp_context['id'] = event.id
|
||||||
|
|||||||
Reference in New Issue
Block a user