Merge pull request #269 from yarda/containers-fix
Fixed crash when running inside container
This commit is contained in:
commit
379fe5e9e5
2 changed files with 9 additions and 2 deletions
|
|
@ -25,7 +25,11 @@ class Inventory(object):
|
|||
buffer_size = consts.CFG_DEF_UDEV_BUFFER_SIZE
|
||||
|
||||
if (set_receive_buffer_size):
|
||||
self._udev_monitor.set_receive_buffer_size(buffer_size)
|
||||
try:
|
||||
self._udev_monitor.set_receive_buffer_size(buffer_size)
|
||||
except EnvironmentError:
|
||||
log.warn("cannot set udev monitor receive buffer size, we are probably running inside " +
|
||||
"container or with limited capabilites, Tuned functionality may be limited")
|
||||
|
||||
if monitor_observer_factory is None:
|
||||
monitor_observer_factory = _MonitorObserverFactory()
|
||||
|
|
|
|||
|
|
@ -150,7 +150,10 @@ class CPULatencyPlugin(base.Plugin):
|
|||
instance._first_instance = False
|
||||
log.info("Latency settings from non-first CPU plugin instance '%s' will be ignored." % instance.name)
|
||||
|
||||
instance._first_device = list(instance.assigned_devices)[0]
|
||||
try:
|
||||
instance._first_device = list(instance.assigned_devices)[0]
|
||||
except IndexError:
|
||||
instance._first_device = None
|
||||
|
||||
def _instance_cleanup(self, instance):
|
||||
if instance._first_instance:
|
||||
|
|
|
|||
Loading…
Reference in a new issue