'A context manager that will lock on the device given, if
configured to do so.
:param device: name of target device
:raises ReplicationLockTimeout: If the lock on the device
cannot be granted within the configured timeout.'

@contextmanager
def replication_lock(self, device):

    if self.replication_one_per_device:
        dev_path = self.get_dev_path(device)
        with lock_path(dev_path, timeout=self.replication_lock_timeout, timeout_class=ReplicationLockTimeout):
            (yield True)
    else:
        (yield True)
