Fix range on cell to include last row
The script doesn't currently handle the last row properly because range is exclusive of the second parameter. To fix this for the scans I made the following edits:
@@ -145,7 +145,7 @@ def getJustifications(whitelistDir, allFiles, sourceImageGreylistFile):
def justificationsOpenscap(wb, justifications):
# Process OpenSCAP - DISA Compliance tab
sheet = wb["OpenSCAP - DISA Compliance"]
- for r in range(1, sheet.max_row):
+ for r in range(1, sheet.max_row + 1):
cell = sheet.cell(row = r, column = 5)
if cell.value == 'identifiers':
cell = sheet.cell(row = r, column = 10)
@@ -163,7 +163,7 @@ def justificationsOpenscap(wb, justifications):
def justificationsTwistlock(wb, justifications):
# Process Twistlock Vulnerability Results tab
sheet = wb["Twistlock Vulnerability Results"]
- for r in range(1, sheet.max_row):
+ for r in range(1, sheet.max_row + 1):
cell = sheet.cell(row = r, column = 1)
if cell.value == 'id':
cell = sheet.cell(row = r, column = 10)
@@ -181,7 +181,7 @@ def justificationsTwistlock(wb, justifications):
##### Process Anchore justifications
def justificationsAnchore(wb, justifications):
sheet = wb["Anchore CVE Results"]
- for r in range(1, sheet.max_row):
+ for r in range(1, sheet.max_row + 1):
I am not able to fork the repo to actually create an MR for this which is why I have to submit an issue.
Thanks, Alvin