disk inventory fix and hp improvement #259
2 changed files with 16 additions and 11 deletions
|
@ -371,7 +371,7 @@ class Inventory():
|
||||||
desc = disk.get('description')
|
desc = disk.get('description')
|
||||||
name = '{} ({})'.format(disk['Model'], disk['Size'])
|
name = '{} ({})'.format(disk['Model'], disk['Size'])
|
||||||
description = disk['Type']
|
description = disk['Type']
|
||||||
sn = getattr(disk, 'SN', 'unknown')
|
sn = disk.get('SN', 'unknown')
|
||||||
|
|
||||||
parms = {
|
parms = {
|
||||||
'device': self.device_id,
|
'device': self.device_id,
|
||||||
|
|
|
@ -18,14 +18,14 @@ def ssacli(sub_command):
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT
|
stderr=subprocess.STDOUT
|
||||||
)
|
)
|
||||||
p.wait()
|
stdout, stderr = p.communicate()
|
||||||
stdout = p.stdout.read().decode("utf-8")
|
stdout = stdout.decode("utf-8")
|
||||||
if p.returncode != 0 and 'does not have any physical' not in stdout:
|
if p.returncode != 0:
|
||||||
mesg = "Failed to execute command '{}':\n{}".format(
|
mesg = "Failed to execute command '{}':\n{}".format(
|
||||||
" ".join(command), stdout
|
" ".join(command), stdout
|
||||||
)
|
)
|
||||||
raise HPRaidControllerError(mesg)
|
raise HPRaidControllerError(mesg)
|
||||||
else:
|
|
||||||
if 'does not have any physical' in stdout:
|
if 'does not have any physical' in stdout:
|
||||||
return list()
|
return list()
|
||||||
else:
|
else:
|
||||||
|
@ -172,7 +172,12 @@ class HPRaidController(RaidController):
|
||||||
'Type': 'SSD' if attrs.get('Interface Type') == 'Solid State SATA'
|
'Type': 'SSD' if attrs.get('Interface Type') == 'Solid State SATA'
|
||||||
else 'HDD',
|
else 'HDD',
|
||||||
'_src': self.__class__.__name__,
|
'_src': self.__class__.__name__,
|
||||||
'custom_fields': {'pd_identifier': name}
|
'custom_fields': {
|
||||||
|
'pd_identifier': name,
|
||||||
|
'mount_point': attrs['Mount Points'],
|
||||||
|
'vd_device': attrs['Disk Name'],
|
||||||
|
'vd_size': attrs['Size'],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue