From 016cda4cbd023bb77c9838ca3a30ceac9c5308d2 Mon Sep 17 00:00:00 2001 From: Ruoyu Ying Date: Fri, 31 May 2019 01:45:07 +0800 Subject: Remove duplicate 'flavorId' in directives Issue-ID: OPTFRA-499 Signed-off-by: Ruoyu Ying Change-Id: Ic680060a8bdff7ea0fb5ae91da80e872ccbd0b49 --- conductor/conductor/data/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conductor/conductor/data/service.py b/conductor/conductor/data/service.py index 09756d2..0b66b22 100644 --- a/conductor/conductor/data/service.py +++ b/conductor/conductor/data/service.py @@ -559,7 +559,8 @@ class DataEndpoint(object): for ele in directives: if "flavor_directives" in ele.get("type"): flag = True - ele.get("attributes").append(flavor_id_attributes) + if len(ele.get("attributes")) <= 1: + ele.get("attributes").append(flavor_id_attributes) break else: flag = False -- cgit 1.2.3-korg