truenas / py-SMART

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

Which smrartctl path #60

Closed ulmitov closed 1 year ago

ulmitov commented 1 year ago

Hi,

Sometimes smartctl is not installed on the system and run from a local dir. So which("smartctl") will return None since i will not find the command. Also the path could be an empty path...so in both cases init of smartctl class fails. Can it check for "self.smartctl_path == None" instead of "not self.smartctl_path" ?

Thanks

ralequi commented 1 year ago

Hi @ulmitov ,

I don't understand exactly which your request is. We agree that smartctl should be installed, and that's why `not self.smartctl_path`` is there.

How do you propose to check if it is installed or not? If it not, and, exec path is manually unset, a error behavior seems to be the correct one.

ulmitov commented 1 year ago

Ahh correct, this one is not relevant, closing