Netbox Inventory: Group By Platforms (#52780)

Fixes the functionality to group_by 'platforms'. Adds the call to self.refresh_platforms_lookup
back and fixes square brackets to return a list instead of a string.
This commit is contained in:
Kris Amundson 2019-04-03 11:39:00 -07:00 committed by Nilashish Chakraborty
parent c11af3dbef
commit f9dfb78d3c

View file

@ -222,7 +222,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
def extract_platform(self, host): def extract_platform(self, host):
try: try:
return self.platforms_lookup[host["platform"]["id"]] return [self.platforms_lookup[host["platform"]["id"]]]
except Exception: except Exception:
return return
@ -345,6 +345,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
self.refresh_tenants_lookup, self.refresh_tenants_lookup,
self.refresh_racks_lookup, self.refresh_racks_lookup,
self.refresh_device_roles_lookup, self.refresh_device_roles_lookup,
self.refresh_platforms_lookup,
self.refresh_device_types_lookup, self.refresh_device_types_lookup,
self.refresh_manufacturers_lookup, self.refresh_manufacturers_lookup,
) )