Skip to content

Commit

Permalink
Strip spaces in csv fields
Browse files Browse the repository at this point in the history
Remove spaces in the csv fields for comparision to work

Change-Id: Idf0316f7b92035cc58278c5e7af03e906da9cebc
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47997
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
Shakeebbk authored and sgupta2m committed Oct 5, 2017
1 parent 248f420 commit 1721a82
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/build/security/securityRegListGen.py
Expand Up @@ -551,9 +551,9 @@ def main(argv):
reader = csv.DictReader(f)
for idx, row in enumerate(reader):
try:
if(version.lower() == 'unknown'):
if(version.strip().lower() == 'unknown'):
version = row[TAG_VERSION]
base_addr = row[TAG_BASE_ADDR].lower().split('0x')[-1]
base_addr = row[TAG_BASE_ADDR].strip().lower().split('0x')[-1]
# Append 0s for numbers represented by less than 8 chars
base_addr = '0'*(8-len(base_addr))+base_addr
# Extract the least 32 bit number for base address
Expand All @@ -565,8 +565,8 @@ def main(argv):
# Empty range field considered as error
if(chiplet_range[0] == ''):
exit(PRINT_AND_EXIT, "Missing chiplet id range")
if(chiplet_range[0].lower() != '0x00'):
if(chiplet_range[0].lower() != '0x%02x' % (get_chiplet(base_addr))):
if(chiplet_range[0].strip().lower() != '0x00'):
if(chiplet_range[0].strip().lower() != '0x%02x' % (get_chiplet(base_addr))):
print "base_addr",hex(base_addr)
print "get_chiplet(base_addr)",hex(get_chiplet(base_addr))
print "chiplet_range[0]", chiplet_range[0]
Expand All @@ -581,12 +581,12 @@ def main(argv):
expanded_line = get_effective_address(row[TAG_CHIPLET], expanded_line)
if(VERBOSE):
print s_list_hex("range:", expanded_range, 8)
if(row[TAG_TYPE].lower() == TAG_NAME_WHITELIST):
if(row[TAG_TYPE].strip().lower() == TAG_NAME_WHITELIST):
whitelist_line = expanded_line
if(VERBOSE):
print s_list_hex("whitelist_line:", whitelist_line, 8)
whitelist += whitelist_line
elif(row[TAG_TYPE].lower() == TAG_NAME_BLACKLIST):
elif(row[TAG_TYPE].strip().lower() == TAG_NAME_BLACKLIST):
blacklist_line = expanded_line
if(VERBOSE):
print s_list_hex("blacklist_line:", blacklist_line, 8)
Expand Down

0 comments on commit 1721a82

Please sign in to comment.