'Check acl invalid args'

def check_acl_args(self):

    need_cfg = False
    find_flag = False
    self.cur_acl_cfg['acl_info'] = []
    if self.acl_name:
        if self.acl_name.isdigit():
            if ((int(self.acl_name) < 3000) or (int(self.acl_name) > 3999)):
                self.module.fail_json(msg='Error:    The    value    of    acl_name    is    out    of    [3000-3999]    for    advance    ACL.')
            if self.acl_num:
                self.module.fail_json(msg='Error:    The    acl_name    is    digit,    so    should    not    input    acl_num    at    the    same    time.')
        else:
            self.acl_type = 'Advance'
            if ((len(self.acl_name) < 1) or (len(self.acl_name) > 32)):
                self.module.fail_json(msg='Error:    The    len    of    acl_name    is    out    of    [1    -    32].')
            if (self.state == 'present'):
                if ((not self.acl_num) and (not self.acl_type) and (not self.rule_name)):
                    self.module.fail_json(msg='Error:    Please    input    acl_num    or    acl_type    when    config    ACL.')
        if self.acl_num:
            if self.acl_num.isdigit():
                if ((int(self.acl_num) < 3000) or (int(self.acl_num) > 3999)):
                    self.module.fail_json(msg='Error:    The    value    of    acl_name    is    out    of    [3000-3999]    for    advance    ACL.')
            else:
                self.module.fail_json(msg='Error:    The    acl_num    is    not    digit.')
        if self.acl_step:
            if self.acl_step.isdigit():
                if ((int(self.acl_step) < 1) or (int(self.acl_step) > 20)):
                    self.module.fail_json(msg='Error:    The    value    of    acl_step    is    out    of    [1    -    20].')
            else:
                self.module.fail_json(msg='Error:    The    acl_step    is    not    digit.')
        if self.acl_description:
            if ((len(self.acl_description) < 1) or (len(self.acl_description) > 127)):
                self.module.fail_json(msg='Error:    The    len    of    acl_description    is    out    of    [1    -    127].')
        conf_str = CE_GET_ACL_HEADER
        if self.acl_type:
            conf_str += '<aclType></aclType>'
        if self.acl_num:
            conf_str += '<aclNumber></aclNumber>'
        if self.acl_step:
            conf_str += '<aclStep></aclStep>'
        if self.acl_description:
            conf_str += '<aclDescription></aclDescription>'
        conf_str += CE_GET_ACL_TAIL
        recv_xml = self.netconf_get_config(conf_str=conf_str)
        if ('<data/>' in recv_xml):
            find_flag = False
        else:
            xml_str = recv_xml.replace('\r', '').replace('\n', '').replace('xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"', '').replace('xmlns="http://www.huawei.com/netconf/vrp"', '')
            root = ElementTree.fromstring(xml_str)
            acl_info = root.findall('data/acl/aclGroups/aclGroup')
            if acl_info:
                for tmp in acl_info:
                    tmp_dict = dict()
                    for site in tmp:
                        if (site.tag in ['aclNumOrName', 'aclType', 'aclNumber', 'aclStep', 'aclDescription']):
                            tmp_dict[site.tag] = site.text
                    self.cur_acl_cfg['acl_info'].append(tmp_dict)
            if self.cur_acl_cfg['acl_info']:
                for tmp in self.cur_acl_cfg['acl_info']:
                    find_flag = True
                    if (self.acl_name and (tmp.get('aclNumOrName') != self.acl_name)):
                        find_flag = False
                    if (self.acl_type and (tmp.get('aclType') != self.acl_type)):
                        find_flag = False
                    if (self.acl_num and (tmp.get('aclNumber') != self.acl_num)):
                        find_flag = False
                    if (self.acl_step and (tmp.get('aclStep') != self.acl_step)):
                        find_flag = False
                    if (self.acl_description and (tmp.get('aclDescription') != self.acl_description)):
                        find_flag = False
                    if find_flag:
                        break
            else:
                find_flag = False
    if (self.state == 'present'):
        need_cfg = bool((not find_flag))
    elif (self.state == 'delete_acl'):
        need_cfg = bool(find_flag)
    else:
        need_cfg = False
    self.cur_acl_cfg['need_cfg'] = need_cfg
