From da4f474012d1a0e0c933576cccb094d9c99c4faa Mon Sep 17 00:00:00 2001 From: Adam Cecile Date: Tue, 17 Aug 2021 09:42:50 +0200 Subject: [PATCH] Re-run black after 2to3 --- wrapper-scripts/3ware-status | 26 +++++-- wrapper-scripts/aacraid-status | 59 +++++++++++---- wrapper-scripts/megaclisas-status | 118 +++++++++++++++++++----------- wrapper-scripts/sas2ircu-status | 26 +++++-- 4 files changed, 159 insertions(+), 70 deletions(-) diff --git a/wrapper-scripts/3ware-status b/wrapper-scripts/3ware-status index a58ea9f..84c77db 100755 --- a/wrapper-scripts/3ware-status +++ b/wrapper-scripts/3ware-status @@ -151,14 +151,28 @@ for controller in controllerlist: if nagiosmode: if bad: - print("RAID ERROR - Arrays: OK:" + str(nagiosgoodarray) + " Bad:" + str(nagiosbadarray) + " - Disks: OK:" + str(nagiosgooddisk) + " Bad:" + str( - nagiosbaddisk - )) + print( + "RAID ERROR - Arrays: OK:" + + str(nagiosgoodarray) + + " Bad:" + + str(nagiosbadarray) + + " - Disks: OK:" + + str(nagiosgooddisk) + + " Bad:" + + str(nagiosbaddisk) + ) sys.exit(2) else: - print("RAID OK - Arrays: OK:" + str(nagiosgoodarray) + " Bad:" + str(nagiosbadarray) + " - Disks: OK:" + str(nagiosgooddisk) + " Bad:" + str( - nagiosbaddisk - )) + print( + "RAID OK - Arrays: OK:" + + str(nagiosgoodarray) + + " Bad:" + + str(nagiosbadarray) + + " - Disks: OK:" + + str(nagiosgooddisk) + + " Bad:" + + str(nagiosbaddisk) + ) else: if bad: print("\nThere is at least one disk/array in a NOT OPTIMAL state.") diff --git a/wrapper-scripts/aacraid-status b/wrapper-scripts/aacraid-status index 48e5e1b..ba521de 100644 --- a/wrapper-scripts/aacraid-status +++ b/wrapper-scripts/aacraid-status @@ -297,9 +297,23 @@ if printarray: for tasks in tasksinfo: if int(tasks[0]) == int(arrayid): if not config.nagios: - print("c" + str(controllerid - 1) + "u" + str(arrayid) + " | " + raidtype + " | " + arrayinfo[2] + "G | " + arrayinfo[ - 1 - ] + " | " + tasks[1] + " | " + tasks[2] + "%") + print( + "c" + + str(controllerid - 1) + + "u" + + str(arrayid) + + " | " + + raidtype + + " | " + + arrayinfo[2] + + "G | " + + arrayinfo[1] + + " | " + + tasks[1] + + " | " + + tasks[2] + + "%" + ) done = True break if done == False: @@ -346,9 +360,22 @@ while controllerid <= controllernumber: # Matched in members of this array if disk[0] == member: if not config.nagios: - print("c" + str(controllerid - 1) + "u" + str(arrayid) + "d" + str(memberid) + " | " + disk[2] + " " + disk[3] + " " + disk[ - 4 - ] + " | " + disk[1]) + print( + "c" + + str(controllerid - 1) + + "u" + + str(arrayid) + + "d" + + str(memberid) + + " | " + + disk[2] + + " " + + disk[3] + + " " + + disk[4] + + " | " + + disk[1] + ) array_member = True memberid += 1 @@ -362,16 +389,20 @@ while controllerid <= controllernumber: if config.nagios: if bad: - print(( - "RAID ERROR - Controllers OK:%d Bad:%d - Arrays OK:%d Bad:%d - Disks OK:%d Bad:%d" - % (nagiosgoodctrl, nagiosbadctrl, nagiosgoodarray, nagiosbadarray, nagiosgooddisk, nagiosbaddisk) - )) + print( + ( + "RAID ERROR - Controllers OK:%d Bad:%d - Arrays OK:%d Bad:%d - Disks OK:%d Bad:%d" + % (nagiosgoodctrl, nagiosbadctrl, nagiosgoodarray, nagiosbadarray, nagiosgooddisk, nagiosbaddisk) + ) + ) sys.exit(2) else: - print(( - "RAID OK - Controllers OK:%d Bad:%d - Arrays OK:%d Bad:%d - Disks OK:%d Bad:%d" - % (nagiosgoodctrl, nagiosbadctrl, nagiosgoodarray, nagiosbadarray, nagiosgooddisk, nagiosbaddisk) - )) + print( + ( + "RAID OK - Controllers OK:%d Bad:%d - Arrays OK:%d Bad:%d - Disks OK:%d Bad:%d" + % (nagiosgoodctrl, nagiosbadctrl, nagiosgoodarray, nagiosbadarray, nagiosgooddisk, nagiosbaddisk) + ) + ) else: if bad: print("\nThere is at least one disk/array in a NOT OPTIMAL state.") diff --git a/wrapper-scripts/megaclisas-status b/wrapper-scripts/megaclisas-status index f0a42ed..071e514 100755 --- a/wrapper-scripts/megaclisas-status +++ b/wrapper-scripts/megaclisas-status @@ -770,18 +770,21 @@ if printarray: if not nagiosmode: print(ldfmt % ("-- ID", "Type", "Size", "Strpsz", "Flags", "DskCache", "Status", "OS Path", "CacheCade", "InProgress")) if not nagiosmode: - print(ldfmt % ( - arrayinfo[0], - arrayinfo[1], - arrayinfo[2], - arrayinfo[3], - arrayinfo[4], - arrayinfo[5], - arrayinfo[6], - arrayinfo[7], - arrayinfo[8], - arrayinfo[9], - )) + print( + ldfmt + % ( + arrayinfo[0], + arrayinfo[1], + arrayinfo[2], + arrayinfo[3], + arrayinfo[4], + arrayinfo[5], + arrayinfo[6], + arrayinfo[7], + arrayinfo[8], + arrayinfo[9], + ) + ) dbgprint("Array state : LD " + arrayinfo[0] + ", status : " + arrayinfo[6]) if arrayinfo[6] not in ["Optimal", "N/A"]: bad = True @@ -862,17 +865,20 @@ if totaldrivenumber: print(drvfmt % ("-- ID", "Type", "Drive Model", "Size", "Status", "Speed", "Temp", "Slot ID", "LSI ID")) # Drive information if not nagiosmode: - print(drvfmt % ( - str("c" + str(controllerid) + "u" + array[0] + "p" + array[1]), # c0p0 - array[2], # HDD/SDD - array[3], # Model Information (Variable len) - array[4], # Size - array[5], # Status (Variable len) - array[6], # Speed - array[7], # Temp - str("[" + array[8] + ":" + array[9] + "]"), # Slot ID - array[10], - )) # LSI ID + print( + drvfmt + % ( + str("c" + str(controllerid) + "u" + array[0] + "p" + array[1]), # c0p0 + array[2], # HDD/SDD + array[3], # Model Information (Variable len) + array[4], # Size + array[5], # Status (Variable len) + array[6], # Speed + array[7], # Temp + str("[" + array[8] + ":" + array[9] + "]"), # Slot ID + array[10], + ) + ) # LSI ID i = i + 1 controllerid += 1 if not nagiosmode: @@ -969,18 +975,21 @@ if totalunconfdrivenumber: print(drvfmt % ("-- ID", "Type", "Drive Model", "Size", "Status", "Speed", "Temp", "Slot ID", "LSI ID", "Path")) # Drive information if not nagiosmode: - print(drvfmt % ( - str("c" + str(controllerid) + "uXpY"), # cXpY - array[0], # HDD/SDD - array[1], # Model Information (Variable len) - array[2], # Size - array[3], # Status (Variable len) - array[4], # Speed - array[5], # Temp - str("[" + array[6] + ":" + array[7] + "]"), # Slot ID - array[8], # LSI ID - array[9], - )) # OS path, if any + print( + drvfmt + % ( + str("c" + str(controllerid) + "uXpY"), # cXpY + array[0], # HDD/SDD + array[1], # Model Information (Variable len) + array[2], # Size + array[3], # Status (Variable len) + array[4], # Speed + array[5], # Temp + str("[" + array[6] + ":" + array[7] + "]"), # Slot ID + array[8], # LSI ID + array[9], + ) + ) # OS path, if any i += 1 controllerid += 1 if not nagiosmode: @@ -1002,21 +1011,42 @@ if debugmode: if nagiosmode: if bad: - print("RAID ERROR - Arrays: OK:" + str(nagiosgoodarray) + " Bad:" + str(nagiosbadarray) + " - Disks: OK:" + str(nagiosgooddisk) + " Bad:" + str( - nagiosbaddisk - )) + print( + "RAID ERROR - Arrays: OK:" + + str(nagiosgoodarray) + + " Bad:" + + str(nagiosbadarray) + + " - Disks: OK:" + + str(nagiosgooddisk) + + " Bad:" + + str(nagiosbaddisk) + ) sys.exit(2) else: - print("RAID OK - Arrays: OK:" + str(nagiosgoodarray) + " Bad:" + str(nagiosbadarray) + " - Disks: OK:" + str(nagiosgooddisk) + " Bad:" + str( - nagiosbaddisk - )) + print( + "RAID OK - Arrays: OK:" + + str(nagiosgoodarray) + + " Bad:" + + str(nagiosbadarray) + + " - Disks: OK:" + + str(nagiosgooddisk) + + " Bad:" + + str(nagiosbaddisk) + ) else: if bad: # DO NOT MODIFY OUTPUT BELOW # Scripts may relies on it # https://github.com/eLvErDe/hwraid/issues/99 print("\nThere is at least one disk/array in a NOT OPTIMAL state.") - print("RAID ERROR - Arrays: OK:" + str(nagiosgoodarray) + " Bad:" + str(nagiosbadarray) + " - Disks: OK:" + str(nagiosgooddisk) + " Bad:" + str( - nagiosbaddisk - )) + print( + "RAID ERROR - Arrays: OK:" + + str(nagiosgoodarray) + + " Bad:" + + str(nagiosbadarray) + + " - Disks: OK:" + + str(nagiosgooddisk) + + " Bad:" + + str(nagiosbaddisk) + ) sys.exit(1) diff --git a/wrapper-scripts/sas2ircu-status b/wrapper-scripts/sas2ircu-status index 2b0647c..63b1139 100755 --- a/wrapper-scripts/sas2ircu-status +++ b/wrapper-scripts/sas2ircu-status @@ -177,14 +177,28 @@ for ctrl in ctrls: if nagiosmode: if bad: - print("RAID ERROR - Arrays: OK:" + str(nagiosgoodarray) + " Bad:" + str(nagiosbadarray) + " - Disks: OK:" + str(nagiosgooddisk) + " Bad:" + str( - nagiosbaddisk - )) + print( + "RAID ERROR - Arrays: OK:" + + str(nagiosgoodarray) + + " Bad:" + + str(nagiosbadarray) + + " - Disks: OK:" + + str(nagiosgooddisk) + + " Bad:" + + str(nagiosbaddisk) + ) sys.exit(2) else: - print("RAID OK - Arrays: OK:" + str(nagiosgoodarray) + " Bad:" + str(nagiosbadarray) + " - Disks: OK:" + str(nagiosgooddisk) + " Bad:" + str( - nagiosbaddisk - )) + print( + "RAID OK - Arrays: OK:" + + str(nagiosgoodarray) + + " Bad:" + + str(nagiosbadarray) + + " - Disks: OK:" + + str(nagiosgooddisk) + + " Bad:" + + str(nagiosbaddisk) + ) else: if bad: print("\nThere is at least one disk/array in a NOT OPTIMAL state.")