File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -273,10 +273,12 @@ 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
279-
276+ return (
277+ path_stat is not None
278+ and path_stat [0 ] == "failed"
279+ and path_stat [2 ] == "faulty"
280+ )
281+
280282 cmd = f'multipathd -k"fail path { path } "'
281283 if not process .system (cmd ):
282284 return wait .wait_for (is_failed , timeout = 10 ) or False
@@ -293,10 +295,12 @@ 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
299-
298+ return (
299+ path_stat is not None
300+ and path_stat [0 ] == "active"
301+ and path_stat [2 ] == "ready"
302+ )
303+
300304 cmd = f'multipathd -k"reinstate path { path } "'
301305 if not process .system (cmd ):
302306 return wait .wait_for (is_reinstated , timeout = 10 ) or False
You can’t perform that action at this time.
0 commit comments