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
def get_dict_output(self):
if self.description:
return {self.name: {'value': self.value,
'description': self.description}}
else:
return {self.name: {'value': self.value}}

View File

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

View File

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

View File

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