mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2025-07-16 04:02:56 -06:00
corrected linting errors
This commit is contained in:
parent
2a3d586302
commit
906c719863
@ -138,7 +138,7 @@ class PhysicalDevice:
|
|||||||
# Remove duplicates and None values
|
# Remove duplicates and None values
|
||||||
self.hostgroups = list(filter(None, list(set(self.hostgroups))))
|
self.hostgroups = list(filter(None, list(set(self.hostgroups))))
|
||||||
if self.hostgroups:
|
if self.hostgroups:
|
||||||
self.logger.debug(f"Host {self.name}: Should be member "
|
self.logger.debug(f"Host {self.name}: Should be member "
|
||||||
f"of groups: {self.hostgroups}")
|
f"of groups: {self.hostgroups}")
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -11,6 +11,7 @@ class Hostgroup:
|
|||||||
Takes type (vm or dev) and NB object"""
|
Takes type (vm or dev) and NB object"""
|
||||||
|
|
||||||
# pylint: disable=too-many-arguments, disable=too-many-positional-arguments
|
# pylint: disable=too-many-arguments, disable=too-many-positional-arguments
|
||||||
|
# pylint: disable=logging-fstring-interpolation
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
obj_type,
|
obj_type,
|
||||||
@ -93,7 +94,8 @@ class Hostgroup:
|
|||||||
format_options["cluster"] = self.nb.cluster.name
|
format_options["cluster"] = self.nb.cluster.name
|
||||||
format_options["cluster_type"] = self.nb.cluster.type.name
|
format_options["cluster_type"] = self.nb.cluster.type.name
|
||||||
self.format_options = format_options
|
self.format_options = format_options
|
||||||
self.logger.debug(f"Host {self.name}: Resolved properties for use in hostgroups: {self.format_options}")
|
self.logger.debug(f"Host {self.name}: Resolved properties for use "
|
||||||
|
f"in hostgroups: {self.format_options}")
|
||||||
|
|
||||||
def set_nesting(
|
def set_nesting(
|
||||||
self, nested_sitegroup_flag, nested_region_flag, nb_groups, nb_regions
|
self, nested_sitegroup_flag, nested_region_flag, nb_groups, nb_regions
|
||||||
@ -142,7 +144,7 @@ class Hostgroup:
|
|||||||
if bool(hg_output):
|
if bool(hg_output):
|
||||||
return "/".join(hg_output)
|
return "/".join(hg_output)
|
||||||
msg = (
|
msg = (
|
||||||
f"Host {self.name}: Generating hostgroup name for '{hg_format}' failed. "
|
f"Host {self.name}: Generating hostgroup name for '{hg_format}' failed. "
|
||||||
f"This is most likely due to fields that have no value."
|
f"This is most likely due to fields that have no value."
|
||||||
)
|
)
|
||||||
self.logger.warning(msg)
|
self.logger.warning(msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user