You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only regexes that include escapes and such cause errors, but use r""
everywhere for consistency.
Closes: eLvErDe#146
Signed-off-by: Hank Leininger <hlein@korelogic.com>
`# ./megaclisas-status
/root/./megaclisas-status:475: SyntaxWarning: invalid escape sequence '['
dsize = re.sub(" [..$", "", dsize)
/root/./megaclisas-status:491: SyntaxWarning: invalid escape sequence '('
subfstate = re.sub("(.", "", fstate)
/root/./megaclisas-status:533: SyntaxWarning: invalid escape sequence '('
temp = re.sub(" (.)", "", temp)
/root/./megaclisas-status:537: SyntaxWarning: invalid escape sequence '['
cmd = "%s pdrbld -showprog -physdrv[%s:%s] -a%d -NoLog" % (megaclipath, enclid, slotid, controllerid)
/root/./megaclisas-status:582: SyntaxWarning: invalid escape sequence '['
dsize = re.sub(" [..$", "", dsize)
/root/./megaclisas-status:592: SyntaxWarning: invalid escape sequence '('
subfstate = re.sub("(.", "", fstate)
/root/./megaclisas-status:633: SyntaxWarning: invalid escape sequence '('
temp = re.sub("(.)", "", temp)
/root/./megaclisas-status:830: SyntaxWarning: invalid escape sequence '('
if re.match("|".join(["^Online$", "^Online, Spun Up$", "^Rebuilding (.*"]), array[5]):
-- Controller information --
-- ID | H/W Model | RAM | Temp | BBU | Firmware
c0 | PERC H800 Adapter | 512MB | N/A | Good | FW: 12.10.7-0001
This happened when upgrading from Fedora 37 to 39 just now. I have to use double escape chars to make it work.
For example
dsize = re.sub(" \[.*\.*$", "", dsize)
fixed with
dsize = re.sub(" \\[.*\\.*$", "", dsize)
The text was updated successfully, but these errors were encountered: