@@ -213,7 +213,9 @@ def sysctl_fetch(self, key):
213213 def _pci_storage_devices (self ):
214214 result = []
215215 for line in self .lspci_raw .split ("\n " ):
216- if re .search (r'(Fibre Channel|RAID bus controller|Mass storage controller|SCSI storage controller|SATA controller|Serial Attached SCSI controller)' , line , re .M ):
216+ if re .search (
217+ r'(Fibre Channel|RAID bus controller|Mass storage controller|SCSI storage controller|SATA controller|Serial Attached SCSI controller)' ,
218+ line , re .M ):
217219 line = line [8 :]
218220 result .append (line )
219221 return result
@@ -240,12 +242,9 @@ def _dmidecode(self, key):
240242 return self ._shell_out ('dmidecode -s \' {0}\' ' .format (key ), sudo = True )
241243
242244 def _dmi_info (self ):
243- result = {}
244- result ['vendor' ] = self ._dmidecode ('system-manufacturer' )
245- result ['product' ] = self ._dmidecode ('system-product-name' )
246- result ['version' ] = self ._dmidecode ('system-version' )
247- result ['chassis' ] = self ._dmidecode ('chassis-type' )
248- result ['SERIAL' ] = self ._dmidecode ('system-serial-number' )
245+ result = {'vendor' : self ._dmidecode ('system-manufacturer' ), 'product' : self ._dmidecode ('system-product-name' ),
246+ 'version' : self ._dmidecode ('system-version' ), 'chassis' : self ._dmidecode ('chassis-type' ),
247+ 'SERIAL' : self ._dmidecode ('system-serial-number' )}
249248 result ['TOTAL' ] = '{0}; {1}; {2} ({3})' .format (
250249 result ['vendor' ], result ['product' ],
251250 result ['chassis' ], result ['version' ])
@@ -305,22 +304,22 @@ def fetch_first(reg, info):
305304 result ['_FLAGS_IMPORTANT' ] = ', ' .join (flags )
306305 result ['speed' ] = fetch_first (
307306 r'^cpu MHz\s+\:\s+(\d+\.\d+)$' , info ) + ' MHz'
308- result ['_TOTAL' ] = 'physical = {0}, cores = {1}, ' \
309- 'virtual = {2}, hyperthreading = {3}' .format (
310- result ['physical' ], result ['cores' ],
311- result ['virtual' ], result ['hyperthreading' ]
307+ result ['_TOTAL' ] = 'physical = {0}, cores = {1}, ' \
308+ 'virtual = {2}, hyperthreading = {3}' .format (
309+ result ['physical' ], result ['cores' ],
310+ result ['virtual' ], result ['hyperthreading' ]
312311 )
313312 return result
314313
315314 def _meminfo (self ):
316315
317316 data , result = self ._read_file ('/proc/meminfo' ), {}
318317 for key in [
319- '_RAW' , '_TOTAL' , '_COMMITED' , '_COMMITEDLIMIT' ,
320- '_FREE' , '_SWAPUSED' , '_SLAB'
321- '_SWAPTOTAL' , '_CACHED' , '_DIRTY' , '_BUFFERS' ,
322- '_HUGEPAGES_SIZE' , '_HUGEPAGES_FREE' ,
323- '_SHMEM' , '_PAGETABLES' ]:
318+ '_RAW' , '_TOTAL' , '_COMMITED' , '_COMMITEDLIMIT' ,
319+ '_FREE' , '_SWAPUSED' , '_SLAB'
320+ '_SWAPTOTAL' , '_CACHED' , '_DIRTY' , '_BUFFERS' ,
321+ '_HUGEPAGES_SIZE' , '_HUGEPAGES_FREE' ,
322+ '_SHMEM' , '_PAGETABLES' ]:
324323 result [key ] = NA
325324
326325 if self .is_empty (data ):
@@ -472,35 +471,35 @@ def _raid(self):
472471 controllers = []
473472 if not self .is_empty (self .lspci_raw ):
474473 if re .search (
475- r'RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS' ,
474+ r'RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS' ,
476475 self .lspci_raw , re .I ):
477476 controllers .append (RAID_LSI )
478477 if re .search (
479- r'RAID bus controller: LSI Logic / Symbios Logic LSI MegaSAS' ,
478+ r'RAID bus controller: LSI Logic / Symbios Logic LSI MegaSAS' ,
480479 self .lspci_raw , re .I ):
481480 controllers .append (RAID_LSI )
482481 if re .search (
483- r'Fusion-MPT SAS' ,
482+ r'Fusion-MPT SAS' ,
484483 self .lspci_raw , re .I ):
485484 controllers .append (RAID_FUSION_SAS )
486485 if re .search (
487- r'RAID bus controller: LSI Logic / Symbios Logic Unknown' ,
486+ r'RAID bus controller: LSI Logic / Symbios Logic Unknown' ,
488487 self .lspci_raw , re .I ):
489488 controllers .append (RAID_LSI )
490489 if re .search (
491- r'RAID bus controller: Adaptec AAC-RAID' ,
490+ r'RAID bus controller: Adaptec AAC-RAID' ,
492491 self .lspci_raw , re .I ):
493492 controllers .append (RAID_ADAPTEC )
494493 if re .search (
495- r'3ware [0-9]* Storage Controller' ,
494+ r'3ware [0-9]* Storage Controller' ,
496495 self .lspci_raw , re .I ):
497496 controllers .append (RAID_3WARE )
498497 if re .search (
499- r'Hewlett-Packard Company Smart Array' ,
498+ r'Hewlett-Packard Company Smart Array' ,
500499 self .lspci_raw , re .I ):
501500 controllers .append (RAID_HP_SMART )
502501 if re .search (
503- r'Hewlett-Packard Company Smart Array' ,
502+ r'Hewlett-Packard Company Smart Array' ,
504503 self .lspci_raw , re .I ):
505504 controllers .append (RAID_HP_SMART )
506505 if not self .is_empty (self .dmesg_raw ):
@@ -511,7 +510,7 @@ def _raid(self):
511510 if re .search (r'scsi[0-9].*: .*aacraid' , self .dmesg_raw , re .I ):
512511 controllers .append (RAID_ADAPTEC )
513512 if re .search (
514- r'scsi[0-9].*: .*3ware [0-9]* Storage Controller' ,
513+ r'scsi[0-9].*: .*3ware [0-9]* Storage Controller' ,
515514 self .dmesg_raw , re .I ):
516515 controllers .append (RAID_3WARE )
517516 if len (controllers ) == 0 :
0 commit comments