File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -273,9 +273,11 @@ def fail_path(path):
273273
274274 def is_failed ():
275275 path_stat = get_path_status (path )
276- if path_stat [0 ] == "failed" and path_stat [2 ] == "faulty" :
277- return True
278- return False
276+ return (
277+ path_stat is not None
278+ and path_stat [0 ] == "failed"
279+ and path_stat [2 ] == "faulty"
280+ )
279281
280282 cmd = f'multipathd -k"fail path { path } "'
281283 if not process .system (cmd ):
@@ -293,9 +295,11 @@ def reinstate_path(path):
293295
294296 def is_reinstated ():
295297 path_stat = get_path_status (path )
296- if path_stat [0 ] == "active" and path_stat [2 ] == "ready" :
297- return True
298- return False
298+ return (
299+ path_stat is not None
300+ and path_stat [0 ] == "active"
301+ and path_stat [2 ] == "ready"
302+ )
299303
300304 cmd = f'multipathd -k"reinstate path { path } "'
301305 if not process .system (cmd ):
You can’t perform that action at this time.
0 commit comments