def ldo_inner1(inst, context, volume_id, attachment_id=None, **kwargs):

    @utils.synchronized(('%s-%s' % (volume_id, f.__name__)), external=True)
    def ldo_inner2(*_args, **_kwargs):
        return f(*_args, **_kwargs)
    return ldo_inner2(inst, context, volume_id, attachment_id, **kwargs)
def ldo_inner1(inst, context, volume_id, attachment_id=None, **kwargs):

    @utils.synchronized(('%s-%s' % (volume_id, f.__name__)), external=True)
    def ldo_inner2(*_args, **_kwargs):
        return f(*_args, **_kwargs)
    return ldo_inner2(inst, context, volume_id, attachment_id, **kwargs)