summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2017-08-15 11:06:49 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-16 10:22:13 -0400
commit4631a4bc4cede3aba04aa2c88a82f0832e2630c6 (patch)
tree579a23429bb88d767730d4e32201eb120ba18038
parent120522fd7f1e9b8e6942a63b43ba0b7c08aa504a (diff)
downloadtalos-hostboot-4631a4bc4cede3aba04aa2c88a82f0832e2630c6.tar.gz
talos-hostboot-4631a4bc4cede3aba04aa2c88a82f0832e2630c6.zip
Update perl syntax in new attr gen scripts for perl v5.6.1
Modern version of perl do not allow using hash as a reference. We were sloppy in a few places in the new scripts, this commit updates the syntax to follow latest standards. Change-Id: I43896749b11ebb38e63c668a1c57fa74270c14d8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44634 Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: STEWART E. SMITH <stewart@linux.vnet.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/handle_duplicate.pl6
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/handle_fapi_attr_mapping.pl6
-rw-r--r--[-rwxr-xr-x]src/usr/targeting/xmltohb/fapi_utils.pl13
3 files changed, 14 insertions, 11 deletions
diff --git a/src/usr/targeting/common/xmltohb/handle_duplicate.pl b/src/usr/targeting/common/xmltohb/handle_duplicate.pl
index 1a03df31a..e41cea3c2 100755
--- a/src/usr/targeting/common/xmltohb/handle_duplicate.pl
+++ b/src/usr/targeting/common/xmltohb/handle_duplicate.pl
@@ -112,7 +112,7 @@ foreach my $attribute (@{$allHBAttributes->{attribute}})
{
if (exists $attribute->{hwpfToHbAttrMap} )
{
- push (@{%hwpfAttributes->{attribute}}, $attribute);
+ push (@{$hwpfAttributes{attribute}}, $attribute);
}
}
@@ -147,7 +147,7 @@ foreach my $ekbAttr (@{$allEKBAttributes->{attribute}})
}
#Loop over HB attrs until we find a match
- foreach my $hbAttr (@{%hwpfAttributes->{attribute}})
+ foreach my $hbAttr (@{$hwpfAttributes{attribute}})
{
my $hbFapiId = $hbAttr->{hwpfToHbAttrMap}[0]->{id};
@@ -217,7 +217,7 @@ foreach my $ekbEnum (@{$allEKBAttributes->{enumerationType}})
my $ekbEnumId = $ekbEnum->{id};
my $theHbEnum;
#we dont want to add duplicates so check if the enumeration exists already in HB
- foreach my $hbEnum (@{%$allHBAttributes->{enumerationType}})
+ foreach my $hbEnum (@{$allHBAttributes->{enumerationType}})
{
my $hbEnumId = $hbEnum->{id};
diff --git a/src/usr/targeting/common/xmltohb/handle_fapi_attr_mapping.pl b/src/usr/targeting/common/xmltohb/handle_fapi_attr_mapping.pl
index 05b2cb7fd..e1f8f7542 100755
--- a/src/usr/targeting/common/xmltohb/handle_fapi_attr_mapping.pl
+++ b/src/usr/targeting/common/xmltohb/handle_fapi_attr_mapping.pl
@@ -113,7 +113,7 @@ foreach my $attribute (@{$allAttributes->{attribute}})
{
if (exists $attribute->{hwpfToHbAttrMap} )
{
- push (@{%hwpfAttributes->{attribute}}, $attribute);
+ push (@{$hwpfAttributes{attribute}}, $attribute);
}
}
@@ -192,7 +192,7 @@ foreach my $targetType ( @{$srcTargetTypes->{targetType}})
}
if($id eq $NewAttr[$i][0])
{
- push (@{%$targetType->{attribute}}, \%attrHash);
+ push (@{$targetType->{attribute}}, \%attrHash);
}
}
}
@@ -205,7 +205,7 @@ foreach my $targetType (@{$srcTargetTypes->{targetType}})
foreach my $attribute (@{$targetType->{attribute}})
{
#check if there is a hostboot mapping w/ a different name
- foreach my $hbMappedAttr (@{%hwpfAttributes->{attribute}})
+ foreach my $hbMappedAttr (@{$hwpfAttributes{attribute}})
{
my $fapiAttrId = $hbMappedAttr->{hwpfToHbAttrMap}[0]->{id};
$fapiAttrId = substr $fapiAttrId , 5;
diff --git a/src/usr/targeting/xmltohb/fapi_utils.pl b/src/usr/targeting/xmltohb/fapi_utils.pl
index 7ba1c1fb1..de451b35e 100755..100644
--- a/src/usr/targeting/xmltohb/fapi_utils.pl
+++ b/src/usr/targeting/xmltohb/fapi_utils.pl
@@ -1,3 +1,4 @@
+#!/usr/bin/perl
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
@@ -24,10 +25,12 @@
# IBM_PROLOG_END_TAG
# A collection of utility functions to convert fapi attributes to targeting attributes
-$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
-my $xml = new XML::Simple (KeyAttr=>[]);
+use XML::Simple;
use Digest::MD5 qw(md5_hex);
use strict;
+$XML::Simple::PREFERRED_PARSER = 'XML::Parser';
+my $xml = new XML::Simple (KeyAttr=>[]);
+
# Convert a FAPI2 target type to the equivalent TARGETING type
# Input: fapi2 type
@@ -360,7 +363,7 @@ sub getArrayDimmensions{
my (%attrHash) = @_;
my $retValue = "";
- my $simpleType = %attrHash->{simpleType};
+ my $simpleType = $attrHash{simpleType};
my @keys = keys (%$simpleType);
@@ -368,7 +371,7 @@ sub getArrayDimmensions{
{
if( $key eq "array")
{
- $retValue .= %attrHash->{simpleType}->{$key};
+ $retValue .= $attrHash{simpleType}->{$key};
}
}
#eat whitespace
@@ -407,7 +410,7 @@ sub getAttrType {
my (%attrHash) = @_;
my $retValue = "";
- my $simpleType = %attrHash->{simpleType};
+ my $simpleType = $attrHash{simpleType};
my @keys = keys (%$simpleType);
OpenPOWER on IntegriCloud