List of canidate identifiers support 86/92186/1
authorLukasz Rajewski <lukasz.rajewski@orange.com>
Mon, 29 Jul 2019 10:18:51 +0000 (12:18 +0200)
committerLukasz Rajewski <lukasz.rajewski@orange.com>
Mon, 29 Jul 2019 10:19:47 +0000 (12:19 +0200)
List of candidate identifers in required and excluded
candidates list now is supported only as a list

Issue-ID: OPTFRA-486
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I2fdc11bc23239eeb1500c95925f8779da89dfcaf

osdf/optimizers/placementopt/conductor/translation.py
test/placement-tests/request_placement_vfmod.json

index e09ecd3..d14f3e1 100644 (file)
@@ -206,10 +206,7 @@ def get_candidates_demands(demand):
     for k, v in policy_config_mapping['candidates'].items():
         if k not in demand:
             continue
-        res[v] = list()
-        for x in demand[k]:
-            for candidate_id in x['identifiers']:
-                res[v].append({'inventory_type': x['identifierType'], 'candidate_id': candidate_id})
+        res[v] = [{'inventory_type': x['identifierType'], 'candidate_id': x['identifiers']} for x in demand[k]]
     return res
 
 
index e4186d6..7c3a2e1 100644 (file)
@@ -53,7 +53,7 @@
                 "service_type": "vFW-SINK-XX",
                 "excluded_candidates": [{
                     "inventory_type": "vfmodule",
-                    "candidate_id": "e765d576-8755-4145-8536-0bb6d9b1dc9a"
+                    "candidate_id": ["e765d576-8755-4145-8536-0bb6d9b1dc9a"]
                 }]
             }],
             "vPGN": [{