'Create a custom update function for a volume.'

def _custom_update(self, operation, state_type, attach_data=A.MISSING_ATTACH_DATA):

    def update(volume):
        '\n                                                Transition    volume    to    desired    end    state    and    attach    data.\n\n                                                :param    boto.ec2.volume.Volume    volume:    Volume    to    move    to\n                                                                invalid    state.\n                                                '
        volume.state = self._pick_end_state(operation, state_type)
        volume.attachments = [self._pick_attach_data(attach_data)]
    return update
