Skip to content

Commit

Permalink
Delete complextype fields in attributes if they have no value
Browse files Browse the repository at this point in the history
The targeting binary build will fail if it sees an attribute with
a complex type that has a field with an empty value tag.  However
if the field isn't present at all, we properly fill in the default
value from our xml metadata files.  This change will delete any
field that is found to have an empty value.

Change-Id: I9d9b2b7870bef067d434f4698efac597043db2bf
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72875
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-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>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
dcrowell77 committed Mar 6, 2019
1 parent 7ce2a9d commit 86b5d35
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/usr/targeting/common/xmltohb/xmltohb.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5543,8 +5543,15 @@ sub packComplexType {
# If native "EntityPath" type, process accordingly
if($field->{type} eq "EntityPath")
{
if( ref($default->{value}) eq "HASH" )
{
#print STDOUT "Skipping empty EntityPath field\n";
}
else
{
$binaryData .= packEntityPath($attributes,
$default->{value});
}
}
# If not a defined simple type, process as an enumeration
elsif(!exists $simpleTypeProperties->{$field->{type}})
Expand Down Expand Up @@ -6418,6 +6425,7 @@ sub generateTargetingImage {

foreach my $targetInstance (@targetsAoH)
{
#print STDOUT "Target=$targetInstance->{id}\n";
my $data;
my %attrhash = ();
my @AoH = ();
Expand Down Expand Up @@ -6525,6 +6533,8 @@ sub generateTargetingImage {
(keys %attrhash)
)
{
#print STDOUT "Id=$attributeId\n";

# Save each target's physical + affinity + parent pervasive
# path for association processing later on
if( ($attributeId eq ATTR_PHYS_PATH)
Expand Down

0 comments on commit 86b5d35

Please sign in to comment.