Embedded nesting in hostgroup init.

This commit is contained in:
Raymond Kuiper
2024-12-18 14:06:40 +01:00
parent 73d5306898
commit ffb8d5239c
3 changed files with 15 additions and 7 deletions

View File

@@ -100,9 +100,11 @@ class PhysicalDevice():
def set_hostgroup(self, hg_format, nb_site_groups, nb_regions):
"""Set the hostgroup for this device"""
# Create new Hostgroup instance
hg = Hostgroup("dev", self.nb, self.nb_api_version)
# Set Hostgroup nesting options
hg.set_nesting(traverse_site_groups, traverse_regions, nb_site_groups, nb_regions)
hg = Hostgroup("dev", self.nb, self.nb_api_version, logger=self.logger,
nested_sitegroup_flag=traverse_site_groups,
nested_region_flag=traverse_regions,
nb_groups=nb_site_groups,
nb_regions=nb_regions)
# Generate hostgroup based on hostgroup format
self.hostgroup = hg.generate(hg_format)