Skip to content

Commit a9d9568

Browse files
committed
CA-417862: tolerate device not found on multipath flush
Signed-off-by: Mark Syms <mark.syms@citrix.com>
1 parent 04f1b09 commit a9d9568

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

libs/sm/core/mpath_dmp.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1515

1616
from sm.core import util
17+
from sm.core.util import CommandException
1718
from sm.core import xs_errors
1819
from sm.core import iscsi
1920
from sm.core import mpath_cli
@@ -82,8 +83,16 @@ def _resetDMP(sid, explicit_unmap=False):
8283
util.retry(
8384
lambda: util.pread2(['/usr/sbin/multipath', '-w', sid]),
8485
maxretry=3, period=4)
85-
util.retry(lambda: util.pread2(['/usr/sbin/multipath', '-f', sid]),
86-
maxretry=3, period=4)
86+
87+
try:
88+
util.retry(
89+
lambda: util.pread2(['/usr/sbin/multipath', '-f', sid]),
90+
maxretry=3, period=4)
91+
except CommandException as ce:
92+
# If the device is already gone then that is what we want
93+
if "device not found" not in ce.reason:
94+
raise
95+
8796
util.retry(lambda: util.pread2(['/usr/sbin/multipath', '-W']),
8897
maxretry=3, period=4)
8998
else:

0 commit comments

Comments
 (0)