'Connects to LUN or snapshot, and makes sure disconnect finally.
:param lun_or_snap: the LUN or snapshot to connect/disconnect.
:param connector: the host connector information.
:param res_id: the ID of the LUN or snapshot.
:return: the connection information, in a dict with format
like (same as the one returned by `_connect_device`):
\'conn\': <info returned by `initialize_connection`>,
\'device\': <value returned by `connect_volume`>,
\'connector\': <host connector info>'

@contextlib.contextmanager
def _connect_resource(self, lun_or_snap, connector, res_id):

    init_conn_func = functools.partial(self._initialize_connection, lun_or_snap, connector, res_id)
    term_conn_func = functools.partial(self._terminate_connection, lun_or_snap, connector)
    with utils.assure_cleanup(init_conn_func, term_conn_func, False) as conn_info:
        conn_device_func = functools.partial(self._connect_device, conn_info)
        with utils.assure_cleanup(conn_device_func, self._disconnect_device, True) as attach_info:
            (yield attach_info)
