diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2018-03-16 11:04:55 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-03-22 15:30:01 -0400 |
commit | 4d755323a66012b675c9c2ca8fe4f551545511a6 (patch) | |
tree | 320e49830788490e0638fc6de15ca0fc11244545 /src/usr/targeting | |
parent | a48f950445f16417996399d0630b485b84c1203c (diff) | |
download | talos-hostboot-4d755323a66012b675c9c2ca8fe4f551545511a6.tar.gz talos-hostboot-4d755323a66012b675c9c2ca8fe4f551545511a6.zip |
Completely hide attributes that have no value
Serverwiz2 continues to output invalid attribute syntax where
attributes are defined with blank default tags like this.
<attribute>
<id>VCS_AVSBUS_BUSNUM</id>
<default></default>
</attribute>
Which then get converted into something like this in our
parsed xml.
<attribute>
<id>VCS_AVSBUS_BUSNUM</id>
</attribute>
That syntax results in our xmltohb parser using a value of zero
instead of the defined default in the attribute definition since
it looks like the value is being explicitly overridden.
The change here is to completely skip adding any attribute that
does not have a value filled in. The attribute's value will then
be sourced from the defaults in attribute_types/target_types.
Change-Id: I3565ff3bf50f9cd8b8f5ef108d8690016cf3f5f2
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55970
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/targeting')
-rw-r--r-- | src/usr/targeting/common/Targets.pm | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/usr/targeting/common/Targets.pm b/src/usr/targeting/common/Targets.pm index 71ea584c9..bb41a19f9 100644 --- a/src/usr/targeting/common/Targets.pm +++ b/src/usr/targeting/common/Targets.pm @@ -284,6 +284,14 @@ sub printAttribute my $build = shift; my $r = ""; + # Read the value right away so we can decide if it is even valid + my $value = $target_ptr->{$attribute}->{default}; + if ($value eq "") + { + print " Targets.pm> WARNING: empty default tag for attribute : $attribute\n"; + return; + } + # TODO RTC: TBD # temporary until we converge attribute types my %filter; @@ -297,9 +305,11 @@ sub printAttribute { print $fh "\t<compileAttribute>\n"; } - else{ print $fh "\t<attribute>\n";} + else + { + print $fh "\t<attribute>\n"; + } print $fh "\t\t<id>$attribute</id>\n"; - my $value = $target_ptr->{$attribute}->{default}; if (ref($value) eq "HASH") { @@ -316,15 +326,17 @@ sub printAttribute } else { - if ($value ne "") { - print $fh "\t\t<default>$value</default>\n"; - } + print $fh "\t\t<default>$value</default>\n"; } + if ( $build eq "fsp" && ($attribute eq "INSTANCE_PATH" || $attribute eq "PEER_HUID")) { print $fh "\t</compileAttribute>\n"; } - else{ print $fh "\t</attribute>\n";} + else + { + print $fh "\t</attribute>\n"; + } } ## stores TYPE enumeration values which is used to generate HUIDs |