Truncate GPU product name to 50 characteres. #169

Merged
cyrinux merged 1 commit from fix_gpu_too_long into master 2020-10-14 12:39:58 +02:00

View file

@ -442,6 +442,8 @@ class Inventory():
def create_netbox_gpus(self):
for gpu in self.lshw.get_hw_linux('gpu'):
if 'product' in gpu and len(gpu['product']) > 50:
gpu['product'] = (gpu['product'][:48] + '..')
manufacturer = self.find_or_create_manufacturer(gpu["vendor"])
_ = nb.dcim.inventory_items.create(
device=self.device_id,