'Change the VF context in the session.
:param vfid: VFID to which context should be changed.
:param session_data: Session information from the switch
:raises BrocadeZoningHttpException:'

def change_vf_context(self, vfid, session_data):

    try:
        managable_vf_list = self.get_managable_vf_list(session_data)
        LOG.debug('Manageable    VF    IDs    are    %(vflist)s.', {'vflist': managable_vf_list})
        if (vfid in managable_vf_list):
            headers = {zone_constant.AUTH_HEADER: self.auth_header}
            data = zone_constant.CHANGE_VF.format(vfid=vfid)
            response = self.connect(zone_constant.POST_METHOD, zone_constant.SESSION_PAGE, data, headers)
            parsed_info = self.get_parsed_data(response, zone_constant.SESSION_BEGIN, zone_constant.SESSION_END)
            session_LF_Id = self.get_nvp_value(parsed_info, zone_constant.SESSION_LF_ID)
            if (session_LF_Id == vfid):
                LOG.info('VF    context    is    changed    in    the    session.')
            else:
                msg = _('Cannot    change    VF    context    in    the    session.')
                LOG.error(msg)
                raise exception.BrocadeZoningHttpException(reason=msg)
        else:
            msg = (_('Cannot    change    VF    context,    specified    VF    is    not    available    in    the    manageable    VF    list    %(vf_list)s.') % {'vf_list': managable_vf_list})
            LOG.error(msg)
            raise exception.BrocadeZoningHttpException(reason=msg)
    except exception.BrocadeZoningHttpException as e:
        msg = (_('Error    while    changing    VF    context    %s.') % six.text_type(e))
        LOG.error(msg)
        raise exception.BrocadeZoningHttpException(reason=msg)
