diff --git a/drivers/lvutil.py b/drivers/lvutil.py index ceea59f2..6011cfef 100755 --- a/drivers/lvutil.py +++ b/drivers/lvutil.py @@ -181,7 +181,7 @@ def cmd_lvm(cmd, pread_func=util.pread2, *args): util.SMlog("CMD_LVM: Not all lvm arguments are of type 'str'") return None - with Fairlock("multipath"): + with Fairlock("devicemapper"): start_time = time.time() stdout = pread_func([os.path.join(LVM_BIN, lvm_cmd)] + lvm_args, * args) end_time = time.time() @@ -653,7 +653,7 @@ def activateNoRefcount(path, refresh): text = cmd_lvm([CMD_LVCHANGE, "--refresh", path]) mapperDevice = path[5:].replace("-", "--").replace("/", "-") cmd = [CMD_DMSETUP, "table", mapperDevice] - with Fairlock("multipath"): + with Fairlock("devicemapper"): ret = util.pread(cmd) util.SMlog("DM table for %s: %s" % (path, ret.strip())) # Restore slave mode lvm.conf @@ -696,7 +696,7 @@ def _checkActive(path): mapperDevice = path[5:].replace("-", "--").replace("/", "-") cmd = [CMD_DMSETUP, "status", mapperDevice] try: - with Fairlock("multipath"): + with Fairlock("devicemapper"): ret = util.pread2(cmd) mapperDeviceExists = True util.SMlog("_checkActive: %s: %s" % (mapperDevice, ret)) @@ -736,7 +736,7 @@ def _lvmBugCleanup(path): cmd_rf = [CMD_DMSETUP, "remove", mapperDevice, "--force"] try: - with Fairlock("multipath"): + with Fairlock("devicemapper"): util.pread(cmd_st, expect_rc=1) except util.CommandException as e: if e.code == 0: @@ -752,14 +752,14 @@ def _lvmBugCleanup(path): util.SMlog("_lvmBugCleanup: removing dm device %s" % mapperDevice) for i in range(LVM_FAIL_RETRIES): try: - with Fairlock("multipath"): + with Fairlock("devicemapper"): util.pread2(cmd_rm) break except util.CommandException as e: if i < LVM_FAIL_RETRIES - 1: util.SMlog("Failed on try %d, retrying" % i) try: - with Fairlock("multipath"): + with Fairlock("devicemapper"): util.pread(cmd_st, expect_rc=1) util.SMlog("_lvmBugCleanup: dm device {}" " removed".format(mapperDevice) @@ -804,7 +804,7 @@ def removeDevMapperEntry(path, strict=True): if not strict: cmd = [CMD_DMSETUP, "status", path] try: - with Fairlock("multipath"): + with Fairlock("devicemapper"): util.pread(cmd, expect_rc=1) return True except: diff --git a/drivers/mpath_cli.py b/drivers/mpath_cli.py index 97ab282e..4c7ce54a 100755 --- a/drivers/mpath_cli.py +++ b/drivers/mpath_cli.py @@ -33,7 +33,7 @@ def __str__(self): def mpexec(cmd): util.SMlog("mpath cmd: %s" % cmd) - with Fairlock("multipath"): + with Fairlock("devicemapper"): (rc, stdout, stderr) = util.doexec(mpathcmd, cmd) if stdout != "multipathd> ok\nmultipathd> " \ and stdout != "multipathd> " + cmd + "\nok\nmultipathd> ": @@ -79,7 +79,7 @@ def is_working(): def do_get_topology(cmd): util.SMlog("mpath cmd: %s" % cmd) - with Fairlock("multipath"): + with Fairlock("devicemapper"): (rc, stdout, stderr) = util.doexec(mpathcmd, cmd) util.SMlog("mpath output: %s" % stdout) lines = stdout.split('\n')[:-1] @@ -112,7 +112,7 @@ def list_paths(scsi_id): def list_maps(): cmd = "list maps" util.SMlog("mpath cmd: %s" % cmd) - with Fairlock("multipath"): + with Fairlock("devicemapper"): (rc, stdout, stderr) = util.doexec(mpathcmd, cmd) util.SMlog("mpath output: %s" % stdout) return [x.split(' ')[0] for x in stdout.split('\n')[2:-1]] diff --git a/drivers/mpath_dmp.py b/drivers/mpath_dmp.py index 9fe9a2fd..a570793f 100755 --- a/drivers/mpath_dmp.py +++ b/drivers/mpath_dmp.py @@ -78,7 +78,7 @@ def _resetDMP(sid, explicit_unmap=False): # tables. In that case, list_paths will return [], but remove_map might # throw an exception. Catch it and ignore it. if explicit_unmap: - with Fairlock("multipath"): + with Fairlock("devicemapper"): util.retry(lambda: util.pread2(['/usr/sbin/multipath', '-f', sid]), maxretry=3, period=4) util.retry(lambda: util.pread2(['/usr/sbin/multipath', '-W']), maxretry=3, @@ -111,13 +111,13 @@ def refresh(sid, npaths): def _is_valid_multipath_device(sid): # Check if device is already multipathed - with Fairlock("multipath"): + with Fairlock("devicemapper"): (ret, stdout, stderr) = util.doexec(['/usr/sbin/multipath', '-l', sid]) if not stdout + stderr: - with Fairlock("multipath"): + with Fairlock("devicemapper"): (ret, stdout, stderr) = util.doexec(['/usr/sbin/multipath', '-ll', sid]) if not stdout + stderr: - with Fairlock("multipath"): + with Fairlock("devicemapper"): (ret, stdout, stderr) = util.doexec(['/usr/sbin/multipath', '-a', sid]) if ret < 0: util.SMlog("Failed to add {}: wwid could be explicitly " @@ -136,7 +136,7 @@ def _is_valid_multipath_device(sid): for dev in devs: devpath = os.path.join(by_scsid_path, dev) real_path = util.get_real_path(devpath) - with Fairlock("multipath"): + with Fairlock("devicemapper"): (ret, stdout, stderr) = util.doexec(['/usr/sbin/multipath', '-c', real_path]) if ret == 0: break @@ -150,7 +150,7 @@ def _is_valid_multipath_device(sid): if not stdout + stderr: # Attempt to cleanup wwids file before raising try: - with Fairlock("multipath"): + with Fairlock("devicemapper"): (ret, stdout, stderr) = util.doexec(['/usr/sbin/multipath', '-w', sid]) except OSError: util.SMlog("Error removing {} from wwids file".format(sid)) @@ -170,7 +170,7 @@ def _refresh_DMP(sid, npaths): path = os.path.join(DEVMAPPERPATH, sid) # If the mapper path doesn't exist force a reload in multipath if not os.path.exists(path): - with Fairlock("multipath"): + with Fairlock("devicemapper"): util.retry(lambda: util.pread2(['/usr/sbin/multipath', '-r', sid]), maxretry=3, period=4) util.wait_for_path(path, 30) if not os.path.exists(path):