diff options
author | Ruoyu <ruoyu.ying@intel.com> | 2018-11-22 03:42:09 +0000 |
---|---|---|
committer | Ruoyu <ruoyu.ying@intel.com> | 2018-11-28 02:16:25 +0000 |
commit | 90e318d450e18075e991671c31ac87259a695e1e (patch) | |
tree | 0d251232460a0622960afc99a1b6a593328af0be | |
parent | 633927402f317714069ae71e0ee766a0d54194ed (diff) |
Return flavor-id in OOF response1.2.5
Add flavor-id in OOF response
Change-Id: I56d33eef06504f66c41b793d93d132b21a27b0dc
Issue-ID: OPTFRA-401
Signed-off-by: Ruoyu <ruoyu.ying@intel.com>
-rw-r--r-- | conductor/conductor/data/plugins/inventory_provider/hpa_utils.py | 4 | ||||
-rw-r--r-- | conductor/conductor/data/service.py | 6 | ||||
-rw-r--r-- | conductor/conductor/solver/service.py | 4 | ||||
-rw-r--r-- | conductor/pom.xml | 4 | ||||
-rw-r--r-- | pom.xml | 2 | ||||
-rwxr-xr-x | run-dockers.sh | 2 | ||||
-rw-r--r-- | version.properties | 2 |
7 files changed, 14 insertions, 10 deletions
diff --git a/conductor/conductor/data/plugins/inventory_provider/hpa_utils.py b/conductor/conductor/data/plugins/inventory_provider/hpa_utils.py index 26133bc..84d4c87 100644 --- a/conductor/conductor/data/plugins/inventory_provider/hpa_utils.py +++ b/conductor/conductor/data/plugins/inventory_provider/hpa_utils.py @@ -272,9 +272,9 @@ class HpaMatchProvider(object): req_attr_key, flavor_cfa) if not flavor_feature_attr: flavor_flag = False - if not self._compare_attribute(flavor_feature_attr[0], + elif not self._compare_attribute(flavor_feature_attr[0], req_feature_attr): - flavor_flag = False + flavor_flag = False if not flavor_flag: continue else: diff --git a/conductor/conductor/data/service.py b/conductor/conductor/data/service.py index 07fc873..832b4f8 100644 --- a/conductor/conductor/data/service.py +++ b/conductor/conductor/data/service.py @@ -511,7 +511,9 @@ class DataEndpoint(object): candidate_list[i]["flavor_map"] = {} # Create flavor mapping for label_name to flavor flavor_name = flavor_info.get("flavor-name") + flavor_id = flavor_info.get("flavor-id") candidate_list[i]["flavor_map"][label_name] = flavor_name + candidate_list[i]["flavor_map"]["flavorId"] = flavor_id # Create directives if not exist already if not candidate_list[i].get("all_directives"): candidate_list[i]["all_directives"] = {} @@ -549,9 +551,11 @@ class DataEndpoint(object): directive= {"id": id, "type": type, "directives": ""} + flavor_id_attributes = {"attribute_name": "flavorId", "attribute_value": ""} for ele in directives: if "flavor_directives" in ele.get("type"): flag = True + ele.get("attributes").append(flavor_id_attributes) break else: flag = False @@ -727,4 +731,4 @@ class DataEndpoint(object): # 'note': 'do_something called!', # 'arg': str(arg), # } - # return {'response': res, 'error': False}
\ No newline at end of file + # return {'response': res, 'error': False} diff --git a/conductor/conductor/solver/service.py b/conductor/conductor/solver/service.py index 9d7f13b..8647e4b 100644 --- a/conductor/conductor/solver/service.py +++ b/conductor/conductor/solver/service.py @@ -739,11 +739,11 @@ class SolverService(cotyledon.Service): :param flavor_map: flavor map get :param directives: All the directives get from request ''' - flavor_label = flavor_map.keys() + keys = flavor_map.keys() for ele in directives.get("directives"): for item in ele.get("directives"): if "flavor_directives" in item.get("type"): for attr in item.get("attributes"): attr["attribute_value"] = flavor_map.get(attr["attribute_name"]) \ - if attr.get("attribute_name") in flavor_label else "" + if attr.get("attribute_name") in keys else "" return directives diff --git a/conductor/pom.xml b/conductor/pom.xml index 9d21f26..c1f04a4 100644 --- a/conductor/pom.xml +++ b/conductor/pom.xml @@ -21,13 +21,13 @@ <parent> <groupId>org.onap.optf.has</groupId> - <version>1.2.4-SNAPSHOT</version> + <version>1.2.5-SNAPSHOT</version> <artifactId>optf-has</artifactId> </parent> <groupId>org.onap.optf.has</groupId> <artifactId>optf-has-conductor</artifactId> - <version>1.2.4-SNAPSHOT</version> + <version>1.2.5-SNAPSHOT</version> <name>optf-has-conductor</name> <description>Homing Allocation Service/Conductor</description> @@ -28,7 +28,7 @@ <artifactId>optf-has</artifactId> <name>optf-has</name> - <version>1.2.4-SNAPSHOT</version> + <version>1.2.5-SNAPSHOT</version> <description>Homing Allocation Service</description> <modules> diff --git a/run-dockers.sh b/run-dockers.sh index 220e9bf..f6836c6 100755 --- a/run-dockers.sh +++ b/run-dockers.sh @@ -4,7 +4,7 @@ BUILD_ARGS="--no-cache" ORG="onap" -VERSION="1.2.4" +VERSION="1.2.5" PROJECT="optf-has" DOCKER_REPOSITORY="nexus3.onap.org:10003" IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}" diff --git a/version.properties b/version.properties index c61a792..901aa18 100644 --- a/version.properties +++ b/version.properties @@ -19,7 +19,7 @@ major=1 minor=2 -patch=4 +patch=5 base_version=${major}.${minor}.${patch} |