pep8 fixes and logging

This commit is contained in:
Solvik Blum 2019-08-21 10:40:32 +02:00
parent 4afd3b9170
commit b30591b382
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47
6 changed files with 38 additions and 11 deletions

View file

@ -12,6 +12,7 @@ class RaidController():
def get_firmware_version(self):
raise NotImplementedError
class Raid():
def get_controllers(self):
raise NotImplementedError

View file

@ -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')

View file

@ -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):