File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1515
1616from sm .core import util
17+ from sm .core .util import CommandException
1718from sm .core import xs_errors
1819from sm .core import iscsi
1920from 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 :
You can’t perform that action at this time.
0 commit comments