tuned icon indicating copy to clipboard operation
tuned copied to clipboard

IndexError is raised in cpu plugin if no devices match

Open olysonek opened this issue 6 years ago • 0 comments

Consider the following profile:

[cpu]
devices=foobar

The devices option doesn't match any CPUs. If you run tuned with this profile, you'll get an IndexError:

Traceback (most recent call last):
  File "/usr/lib64/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.7/site-packages/tuned/daemon/daemon.py", line 132, in _thread_code
    self._unit_manager.create(self._profile.units)
  File "/usr/lib/python3.7/site-packages/tuned/units/manager.py", line 70, in create
    plugin.initialize_instance(new_instance)
  File "/usr/lib/python3.7/site-packages/tuned/plugins/base.py", line 112, in initialize_instance
    self._instance_init(instance)
  File "/usr/lib/python3.7/site-packages/tuned/plugins/plugin_cpu.py", line 121, in _instance_init
    instance._first_device = list(instance.devices)[0]
IndexError: list index out of range

olysonek avatar Mar 06 '19 18:03 olysonek