Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing multipath flush problem in module_load_unload.py #2761

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion io/driver/module_unload_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def flush_mpath(self, mdl):
"""
flush the multipath
"""
cmd = "lsmod | grep -i ^%s" % mdl
cmd = "lsmod | grep -iw ^%s" % mdl
for i in range(20):
if process.getoutput(cmd).split(" ")[-1] == '0':
return True
Expand Down Expand Up @@ -106,18 +106,26 @@ def module_load_unload(self, module_list):
if linux_modules.module_is_loaded(mod) is True:
self.error_modules.append(mod)
break
self.log.info("error_module list before unloading: %s, iteration : %s" % (self.error_modules, _))
self.log.info("unloading module %s " % mdl)
linux_modules.unload_module(mdl)
time.sleep(self.load_unload_sleep_time)
if linux_modules.module_is_loaded(mdl) is True:
self.log.info("failed to unload the module, iteration : %s" % _)
self.error_modules.append(mdl)
break
else:
self.log.info("successfully unload: iteration : %s" % _)
self.log.info("loading module : %s " % mdl)
self.log.info("error_module list before loading: %s,iteration : %s" % (self.error_modules, _))
linux_modules.load_module(mdl)
time.sleep(self.load_unload_sleep_time)
if linux_modules.module_is_loaded(mdl) is False:
self.log.info("failed to load the module, iteration : %s" % _)
self.error_modules.append(mdl)
break
else:
self.log.info("successfully load: iteration : %s" % _)

def test(self):
"""
Expand Down
1 change: 1 addition & 0 deletions io/driver/module_unload_load.py.data/config
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ qla2xxx=multipath
lpfc=multipath
ibmvfc=multipath
nvme_fc=lpfc multipath
nvme=multipath
Loading