pep8 fixes and logging
This commit is contained in:
parent
4afd3b9170
commit
b30591b382
6 changed files with 38 additions and 11 deletions
|
@ -12,6 +12,7 @@ class RaidController():
|
|||
def get_firmware_version(self):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class Raid():
|
||||
def get_controllers(self):
|
||||
raise NotImplementedError
|
||||
|
|
|
@ -35,8 +35,8 @@ class StorcliController(RaidController):
|
|||
drive_identifier = 'Drive /c{}/e{}/s{}'.format(
|
||||
str(self.controller_index), str(enclosure), str(slot)
|
||||
)
|
||||
drive_attr = drive_infos['{} - Detailed Information'.format(drive_identifier)]\
|
||||
['{} Device attributes'.format(drive_identifier)]
|
||||
drive_attr = drive_infos['{} - Detailed Information'.format(drive_identifier)][
|
||||
'{} Device attributes'.format(drive_identifier)]
|
||||
ret.append({
|
||||
'Model': drive_attr.get('Model Number', '').strip(),
|
||||
'SN': drive_attr.get('SN', '').strip(),
|
||||
|
@ -44,6 +44,7 @@ class StorcliController(RaidController):
|
|||
})
|
||||
return ret
|
||||
|
||||
|
||||
class StorcliRaid(Raid):
|
||||
def __init__(self):
|
||||
self.output = subprocess.getoutput('storcli /call show J')
|
||||
|
|
|
@ -123,8 +123,8 @@ class HPRaid(Raid):
|
|||
_product_name = list(info_dict.keys())[0]
|
||||
product_name = REGEXP_CONTROLLER_HP.search(_product_name)
|
||||
if product_name:
|
||||
self.controllers.append(
|
||||
HPRaidController(product_name.group(1), info_dict[_product_name])
|
||||
self.controllers.append(
|
||||
HPRaidController(product_name.group(1), info_dict[_product_name])
|
||||
)
|
||||
|
||||
def get_controllers(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue