diff --git a/agent_based/inv_checkpoint_base.py b/agent_based/inv_checkpoint_base.py index 9f65fb4f7bee28f4a7005e5b28a054fcb3474f63..53215a7c36a5be6120a9072d1d7f7ebac33af68f 100644 --- a/agent_based/inv_checkpoint_base.py +++ b/agent_based/inv_checkpoint_base.py @@ -14,7 +14,7 @@ # 2021-02-08 : transfered license/support info to seperate plugin # 2021-02-22 : code cleanup # 2021-03-05 : added hostlabel section -# 2021-03-18 : fixed missing update agent snmp section.. +# 2021-03-18 : fixed missing update agent snmp section. # # sample string_table # [ @@ -68,27 +68,26 @@ def parse_inv_checkpoint_base(string_table: List[StringTable]) -> List: invPath = ['hardware', 'system'] - if not baseinfo.serialnumber == '': - section.append((invPath, 'serial', baseinfo.serialnumber)) - if not baseinfo.series == '': - section.append((invPath, 'appliance_series', baseinfo.series)) - if not baseinfo.manufacturer == '': - section.append((invPath, 'manufacturer', baseinfo.manufacturer)) - if not baseinfo.productname == '': - section.append((invPath, 'product_name', baseinfo.productname)) + for key, value in [ + ('serial', baseinfo.serialnumber), + ('appliance_series', baseinfo.series), + ('manufacturer', baseinfo.manufacturer), + ('product_name', baseinfo.productname), + ]: + if not value == '': + section.append((invPath, key, value)) invPath = ['software', 'check_point', 'os_info'] - if not baseinfo.version == '': - section.append((invPath, 'svn_version', baseinfo.version)) - if not baseinfo.build == '': - section.append((invPath, 'svn_build', baseinfo.build)) - if not baseinfo.osname == '': - section.append((invPath, 'os_name', baseinfo.osname)) - if not baseinfo.osmajorver == '' and not baseinfo.osminorver == '': - section.append((invPath, 'os_version', baseinfo.osmajorver + '.' + baseinfo.osminorver)) - if not updateagentversion == '': - section.append((invPath, 'deployment_agent_build', updateagentversion)) + for key, value in [ + ('svn_version', baseinfo.version), + ('svn_build', baseinfo.build), + ('os_name', baseinfo.osname), + ('deployment_agent_build', updateagentversion), + ('os_version', baseinfo.osmajorver + '.' + baseinfo.osminorver), + ]: + if not value == '': + section.append((invPath, key, value)) return section diff --git a/inv_checkpoint_base.mkp b/inv_checkpoint_base.mkp index 944c89ad80805677dd9f14db7ca37830322887a5..ceea530d3426e48a5e2060a21d22e4c12114c379 100644 Binary files a/inv_checkpoint_base.mkp and b/inv_checkpoint_base.mkp differ