1
0
Fork 0

scheduler: Catch OSError in addition to IOError

In python3, functions such as open() or readline() raise OSError
instead of IOError.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
Ondřej Lysoněk 2018-06-02 08:26:29 +02:00
parent 625d219f9e
commit 02541dfb5c

View file

@ -204,14 +204,14 @@ class SchedulerPlugin(base.Plugin):
return 0
else:
return 1
except IOError as e:
except (OSError, IOError) as e:
if e.errno == errno.ENOENT or e.errno == errno.ESRCH:
log.debug("Unable to set affinity for PID %s, the task vanished." % pid)
return -1
else:
log.error("Failed to get task info for PID %s: %s" % (pid, str(e)))
return -2
except (OSError, AttributeError, KeyError) as e:
except (AttributeError, KeyError) as e:
log.error("Failed to get task info for PID %s: %s" % (pid, str(e)))
return -2