From e87411e6df60a0ead2f90c6975b5cea8ba1db20d Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Tue, 28 Apr 2020 12:49:39 +0530 Subject: Add nsi info in the nsi selection response Issue-ID: OPTFRA-746 Signed-off-by: krishnaa96 Change-Id: I799c9575b781d858b47e6695050f7f79308fdd43 --- .../optimizers/conductor/response_processor.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/slice_selection/optimizers/conductor/response_processor.py b/apps/slice_selection/optimizers/conductor/response_processor.py index 5b7be01..a841cb5 100644 --- a/apps/slice_selection/optimizers/conductor/response_processor.py +++ b/apps/slice_selection/optimizers/conductor/response_processor.py @@ -43,12 +43,17 @@ def conductor_response_processor(overall_recommendations, nst_info_map, request_ for nst_name, recommendations in overall_recommendations.items(): for recommendation in recommendations: - nsi_set = set(values['candidate']['nsi_name'] for key, values in recommendation.items()) + nsi_set = set(values['candidate']['nsi_id'] for key, values in recommendation.items()) if len(nsi_set) == 1: - nsi = nsi_set.pop() - debug_log.debug("The NSSIs in the solution belongs to the same NSI {}".format(nsi)) + nsi_id = nsi_set.pop() + candidate = list(recommendation.values())[0]['candidate'] + debug_log.debug("The NSSIs in the solution belongs to the same NSI {}" + .format(nsi_id)) shared_nsi_solution = dict() - shared_nsi_solution["NSIName"] = nsi + shared_nsi_solution["NSIId"] = nsi_id + shared_nsi_solution["NSIName"] = candidate.get('nsi_name') + shared_nsi_solution["UUID"] = candidate.get('nsi_model_version_id') + shared_nsi_solution["invariantUUID"] = candidate.get('nsi_model_invariant_id') shared_nsi_solutions.append(shared_nsi_solution) else: nssi_solutions = get_nssi_solutions(recommendation) -- cgit 1.2.3-korg