From ffac34a51c8393c42226f3f1deacffb7db26de6f Mon Sep 17 00:00:00 2001 From: Alex Boag-Munroe <ninpo@qap.la> Date: Thu, 26 Sep 2019 23:40:41 +0100 Subject: [PATCH] Catch IOError for backwards compatability FileNotFoundError is not in Python 2, catch IOError instead. --- bumblebee/modules/zpool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumblebee/modules/zpool.py b/bumblebee/modules/zpool.py index e5f42c6..1f3e897 100644 --- a/bumblebee/modules/zpool.py +++ b/bumblebee/modules/zpool.py @@ -71,7 +71,7 @@ class Module(bumblebee.engine.Module): try: with open(zfs_version_path, 'r') as zfs_mod_version: zfs_version = zfs_mod_version.readline().rstrip().split('-')[0] - except FileNotFoundError: + except IOError: # ZFS isn't installed or the module isn't loaded, stub the version zfs_version = "0.0.0" logging.error("ZFS version information not found at {}, check the module is loaded.".format(zfs_version_path))