Don't put a null value description in the outputs when no description is provided.

Don't create an output if the value is null.

Change-Id: I5ea108ec8f0a9c219535cd82fcf7263c9f61f339
This commit is contained in:
Mathieu Velten 2016-07-01 11:04:26 +02:00
parent a8e2cf59d9
commit e022a26c32
4 changed files with 10 additions and 7 deletions

View File

@ -21,5 +21,8 @@ class HotOutput(object):
self.description = description self.description = description
def get_dict_output(self): def get_dict_output(self):
if self.description:
return {self.name: {'value': self.value, return {self.name: {'value': self.value,
'description': self.description}} 'description': self.description}}
else:
return {self.name: {'value': self.value}}

View File

@ -34,6 +34,7 @@ class TranslateOutputs(object):
hot_outputs = [] hot_outputs = []
for output in self.outputs: for output in self.outputs:
hot_value = self.nodes.translate_param_value(output.value, None) hot_value = self.nodes.translate_param_value(output.value, None)
if hot_value is not None:
hot_outputs.append(HotOutput(output.name, hot_value, hot_outputs.append(HotOutput(output.name, hot_value,
output.description)) output.description))
return hot_outputs return hot_outputs

View File

@ -32,11 +32,10 @@ resources:
get_file: myapp_configure.sh get_file: myapp_configure.sh
outputs: outputs:
map_val: map_val:
description: null description: map_val
value: value:
get_input: map_val get_input: map_val
concat_map_val: concat_map_val:
description: null
value: value:
str_replace: str_replace:
params: params:
@ -46,5 +45,4 @@ outputs:
get_input: map_val get_input: map_val
template: $s0$s1$s2 template: $s0$s1$s2
static_map_val: static_map_val:
description: null
value: static_value value: static_value

View File

@ -71,6 +71,7 @@ topology_template:
outputs: outputs:
map_val: map_val:
description: map_val
value: { get_property: [ myapp, myfeature, my_map, test_key ] } value: { get_property: [ myapp, myfeature, my_map, test_key ] }
static_map_val: static_map_val: