Catch IOError for backwards compatability
FileNotFoundError is not in Python 2, catch IOError instead.
This commit is contained in:
parent
e44eea3318
commit
ffac34a51c
1 changed files with 1 additions and 1 deletions
|
@ -71,7 +71,7 @@ class Module(bumblebee.engine.Module):
|
||||||
try:
|
try:
|
||||||
with open(zfs_version_path, 'r') as zfs_mod_version:
|
with open(zfs_version_path, 'r') as zfs_mod_version:
|
||||||
zfs_version = zfs_mod_version.readline().rstrip().split('-')[0]
|
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 isn't installed or the module isn't loaded, stub the version
|
||||||
zfs_version = "0.0.0"
|
zfs_version = "0.0.0"
|
||||||
logging.error("ZFS version information not found at {}, check the module is loaded.".format(zfs_version_path))
|
logging.error("ZFS version information not found at {}, check the module is loaded.".format(zfs_version_path))
|
||||||
|
|
Loading…
Add table
Reference in a new issue