def external_lock(name, lock_file_prefix=None):
    with internal_lock(name):
        LOG.debug(_('Attempting to grab external lock "%(lock)s"'),
                  {'lock': name})

        # NOTE(mikal): the lock name cannot contain directory
        # separators
        name = name.replace(os.sep, '_')
        if lock_file_prefix:
            sep = '' if lock_file_prefix.endswith('-') else '-'
            name = (lock_file_prefix, sep, name) % '%s%s%s'

        if not CONF.lock_path:
            raise cfg.RequiredOptError('lock_path')

        lock_file_path = os.path.join(CONF.lock_path, name)

        return InterProcessLock(lock_file_path)
dataset/ETHPy150Open openstack/solum/solum/openstack/common/lockutils.py/external_lock/swapped operands of `%`