'Check global args'

def check_global_args(self):

    need_cfg = False
    find_flag = False
    self.cur_global_cfg['global_cfg'] = []
    if (self.trap_time_stamp or (self.trap_buff_enable != 'no_use') or self.trap_buff_size):
        if self.trap_buff_size:
            if self.trap_buff_size.isdigit():
                if ((int(self.trap_buff_size) < 0) or (int(self.trap_buff_size) > 1024)):
                    self.module.fail_json(msg='Error:    The    value    of    trap_buff_size    is    out    of    [0    -    1024].')
            else:
                self.module.fail_json(msg='Error:    The    trap_buff_size    is    not    digit.')
        conf_str = CE_GET_TRAP_GLOBAL_HEADER
        if self.trap_time_stamp:
            conf_str += '<trapTimeStamp></trapTimeStamp>'
        if (self.trap_buff_enable != 'no_use'):
            conf_str += '<icTrapBuffEn></icTrapBuffEn>'
        if self.trap_buff_size:
            conf_str += '<trapBuffSize></trapBuffSize>'
        conf_str += CE_GET_TRAP_GLOBAL_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)
            global_cfg = root.findall('data/syslog/globalParam')
            if global_cfg:
                for tmp in global_cfg:
                    tmp_dict = dict()
                    for site in tmp:
                        if (site.tag in ['trapTimeStamp', 'icTrapBuffEn', 'trapBuffSize']):
                            tmp_dict[site.tag] = site.text
                    self.cur_global_cfg['global_cfg'].append(tmp_dict)
            if self.cur_global_cfg['global_cfg']:
                for tmp in self.cur_global_cfg['global_cfg']:
                    find_flag = True
                    if (self.trap_time_stamp and (tmp.get('trapTimeStamp').lower() != self.trap_time_stamp)):
                        find_flag = False
                    if ((self.trap_buff_enable != 'no_use') and (tmp.get('icTrapBuffEn') != self.trap_buff_enable)):
                        find_flag = False
                    if (self.trap_buff_size and (tmp.get('trapBuffSize') != self.trap_buff_size)):
                        find_flag = False
                    if find_flag:
                        break
            else:
                find_flag = False
        if (self.state == 'present'):
            need_cfg = bool((not find_flag))
        else:
            need_cfg = bool(find_flag)
    self.cur_global_cfg['need_cfg'] = need_cfg
