truenas / py-SMART

Wrapper for smartctl (smartmontools)
GNU Lesser General Public License v2.1
79 stars 35 forks source link

Add vendor info to device #44

Closed pieterhelsen closed 2 years ago

pieterhelsen commented 2 years ago

Added support for reading the Vendor property from the information section. Below are two snippets from WD and Seagate drives that support this property:

=== START OF INFORMATION SECTION ===
Vendor:               Seagate
Product:              ST16000NM001G-2K
=== START OF INFORMATION SECTION ===
Vendor:               WDC
Product:              WD161KRYZ-01AGBB
ralequi commented 2 years ago

Also, if you can add some device test example that checks the vendor, would be welcomed. Thanks for your contrib

pieterhelsen commented 2 years ago

Thanks for the feedback. The tests already included some drives with the Vendor attribute, so I updated the device.json files to check these values as part of the pytest suite.

All tests are passing with a deprecation warning in https://github.com/truenas/py-SMART/blob/b16af735a03c6133604babf6938c4fb3eaa7667a/pySMART/device_list.py#L105 that I decided not to fix within the scope of this PR.

ralequi commented 2 years ago

Hi!

Thank you for your contribution. Much appreciated.