'check need cfg'

def check_need_loghost_cfg(self):

    need_cfg = False
    find_flag = False
    if (self.ip_type and self.server_ip):
        if self.server_ip_info:
            for tmp in self.server_ip_info['serverIpInfos']:
                find_flag = True
                if (self.ip_type and (tmp.get('ipType') != self.ip_type)):
                    find_flag = False
                if (self.server_ip and (tmp.get('serverIp') != self.server_ip)):
                    find_flag = False
                if (self.vrf_name and (tmp.get('vrfName') != self.vrf_name)):
                    find_flag = False
                if (self.level and (tmp.get('level') != self.level)):
                    find_flag = False
                if (self.server_port and (tmp.get('serverPort') != self.server_port)):
                    find_flag = False
                if (self.facility and (tmp.get('facility') != self.facility)):
                    find_flag = False
                if (self.channel_id and (tmp.get('chnlId') != self.channel_id)):
                    find_flag = False
                if (self.channel_name and (tmp.get('chnlName') != self.channel_name)):
                    find_flag = False
                if (self.timestamp and (tmp.get('timestamp') != self.timestamp)):
                    find_flag = False
                if (self.transport_mode and (tmp.get('transportMode') != self.transport_mode)):
                    find_flag = False
                if (self.ssl_policy_name and (tmp.get('sslPolicyName') != self.ssl_policy_name)):
                    find_flag = False
                if (self.source_ip and (tmp.get('sourceIP') != self.source_ip)):
                    find_flag = False
                if find_flag:
                    break
    elif self.server_domain:
        if self.server_domain_info:
            for tmp in self.server_domain_info['serverAddressInfos']:
                find_flag = True
                if (self.server_domain and (tmp.get('serverDomain') != self.server_domain)):
                    find_flag = False
                if (self.vrf_name and (tmp.get('vrfName') != self.vrf_name)):
                    find_flag = False
                if (self.level and (tmp.get('level') != self.level)):
                    find_flag = False
                if (self.server_port and (tmp.get('serverPort') != self.server_port)):
                    find_flag = False
                if (self.facility and (tmp.get('facility') != self.facility)):
                    find_flag = False
                if (self.channel_id and (tmp.get('chnlId') != self.channel_id)):
                    find_flag = False
                if (self.channel_name and (tmp.get('chnlName') != self.channel_name)):
                    find_flag = False
                if (self.timestamp and (tmp.get('timestamp') != self.timestamp)):
                    find_flag = False
                if (self.transport_mode and (tmp.get('transportMode') != self.transport_mode)):
                    find_flag = False
                if (self.ssl_policy_name and (tmp.get('sslPolicyName') != self.ssl_policy_name)):
                    find_flag = False
                if (self.source_ip and (tmp.get('sourceIP') != self.source_ip)):
                    find_flag = False
                if find_flag:
                    break
    else:
        find_flag = False
    if (self.state == 'present'):
        need_cfg = bool((not find_flag))
    elif (self.state == 'absent'):
        need_cfg = bool(find_flag)
    return need_cfg
