Merge pull request #251 from Solvik/fix/dvdrom-inventory

fix: dvdrom inventory crash
This commit is contained in:
Cyril Levis 2022-11-19 09:38:51 +01:00 committed by GitHub
commit 5b0df6ca05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -371,13 +371,14 @@ class Inventory():
desc = disk.get('description')
name = '{} ({})'.format(disk['Model'], disk['Size'])
description = disk['Type']
sn = getattr(disk, 'SN', 'unknown')
parms = {
'device': self.device_id,
'discovered': True,
'tags': [{'name': INVENTORY_TAG['disk']['name']}],
'name': name,
'serial': disk['SN'],
'serial': sn,
'part_id': disk['Model'],
'description': description,
'manufacturer': getattr(manufacturer, "id", None),
@ -389,7 +390,7 @@ class Inventory():
logging.info('Creating Disk {model} {serial}'.format(
model=disk['Model'],
serial=disk['SN'],
serial=sn,
))
def dump_disks_map(self, disks):