make InventoryItem's name attribute <50 char for memory DIMM (#67)

This commit is contained in:
Solvik 2019-09-09 16:52:25 +02:00 committed by GitHub
parent f68fed18b4
commit ba8f58180e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -399,16 +399,16 @@ class Inventory():
def create_netbox_memory(self, memory):
manufacturer = self.find_or_create_manufacturer(memory['vendor'])
name = 'Slot {} ({}GB)'.format(memory['slot'], memory['size'])
nb_memory = nb.dcim.inventory_items.create(
device=self.device_id,
discovered=True,
manufacturer=manufacturer.id,
tags=[INVENTORY_TAG['memory']['name']],
name='{} ({}GB)'.format(memory['description'], memory['size']),
name=name,
part_id=memory['product'],
serial=memory['serial'],
description='Slot {}'.format(memory['slot']),
description=memory['description'],
)
logging.info('Creating Memory {location} {type} {size}GB'.format(