'check_bgp_instance_args'

def check_bgp_instance_args(self, **kwargs):

    module = kwargs['module']
    state = module.params['state']
    need_cfg = False
    vrf_name = module.params['vrf_name']
    if vrf_name:
        if ((len(vrf_name) > 31) or (len(vrf_name) == 0)):
            module.fail_json(msg=('the    len    of    vrf_name    %s    is    out    of    [1    -    31].' % vrf_name))
        conf_str = ((CE_GET_BGP_INSTANCE_HEADER + '<vrfName></vrfName>') + CE_GET_BGP_INSTANCE_TAIL)
        recv_xml = self.netconf_get_config(module=module, conf_str=conf_str)
        check_vrf_name = vrf_name
        if (state == 'present'):
            if ('<data/>' in recv_xml):
                need_cfg = True
            else:
                re_find = re.findall('.*<vrfName>(.*)</vrfName>.*', recv_xml)
                if re_find:
                    if (check_vrf_name not in re_find):
                        need_cfg = True
                else:
                    need_cfg = True
        elif ('<data/>' in recv_xml):
            pass
        else:
            re_find = re.findall('.*<vrfName>(.*)</vrfName>.*', recv_xml)
            if re_find:
                if (check_vrf_name in re_find):
                    need_cfg = True
    return need_cfg
