@@ -152,12 +152,12 @@ def gather_data(configmanager, creds, node):
152152 nssh = enos_login (node = node , configmanager = configmanager , creds = creds )
153153 switch_lines = enos_version (ssh = nssh )
154154 switch_data = {}
155- sysinfo = {"Product name" : {"regex" : ".*RackSwitch (\w+)" },
156- "Serial Number" : {"regex" : "ESN\s*\w*\s*: ([\w-]+)" },
157- "Board Serial Number" : {"regex" : "Switch Serial No: (\w+)" },
158- "Model" : {"regex" : "MTM\s*\w*\s*: ([\w-]+)" },
159- "FRU Number" : {"regex" : "Hardware Part\s*\w*\s*: (\w+)" },
160- "Airflow" : {"regex" : "System Fan Airflow\s*\w*\s*: ([\w-]+)" },
155+ sysinfo = {"Product name" : {"regex" : r ".*RackSwitch (\w+)" },
156+ "Serial Number" : {"regex" : r "ESN\s*\w*\s*: ([\w-]+)" },
157+ "Board Serial Number" : {"regex" : r "Switch Serial No: (\w+)" },
158+ "Model" : {"regex" : r "MTM\s*\w*\s*: ([\w-]+)" },
159+ "FRU Number" : {"regex" : r "Hardware Part\s*\w*\s*: (\w+)" },
160+ "Airflow" : {"regex" : r "System Fan Airflow\s*\w*\s*: ([\w-]+)" },
161161 }
162162
163163 invinfo = {
@@ -233,7 +233,7 @@ def gather_data(configmanager, creds, node):
233233 sysfw = {"Software Version" : "Unknown" , "Boot kernel" : "Unknown" }
234234 for line in switch_lines :
235235 for key in sysfw .keys ():
236- regex = f "{ key } \s*\w*\s* ([0-9.]+)"
236+ regex = rf "{ key } \s*\w*\s* ([0-9.]+)"
237237 match = re .match (re .compile (regex ), line )
238238 if match :
239239 sysfw [key ] = match .group (1 )
@@ -250,7 +250,7 @@ def gather_psus(data):
250250 # others are:
251251 # Internal Power Supply: On
252252 if "Power Supply" in line :
253- match = re .match (re .compile ("Power Supply (\d)+.*" ), line )
253+ match = re .match (re .compile (r "Power Supply (\d)+.*" ), line )
254254 if match :
255255 psu = match .group (1 )
256256 if psu not in psus :
@@ -280,7 +280,7 @@ def gather_fans(data):
280280 for line in data :
281281 # look for presence of fans
282282 if "Fan" in line :
283- match = re .match (re .compile ("Fan (\d)+.*" ), line )
283+ match = re .match (re .compile (r "Fan (\d)+.*" ), line )
284284 if match :
285285 fan = match .group (1 )
286286 if match :
0 commit comments