redhat-performance / tuned

Tuning Profile Delivery Mechanism for Linux
GNU General Public License v2.0
802 stars 177 forks source link

Setting a user defined profile in ppd.conf crashes ppd service #667

Closed ponychicken closed 2 weeks ago

ponychicken commented 1 month ago

tuned/ppd/controller.py

dd0f0fb317c7147104c0f080c86c90b3287cbcd2 Introduced a bug in the init. If switch_profile does not return early, it will look up self_on_battery, which is just set with the next call. For some reason this only becomes a problem when using user defined profiles, it works fine if using a system profile

ponychicken commented 1 month ago
  File "/usr/local/lib/python3.11/dist-packages/tuned/ppd/controller.py", line 106, in __init__
    self.initialize()
  File "/usr/local/lib/python3.11/dist-packages/tuned/ppd/controller.py", line 141, in initialize
    self.switch_profile(self._base_profile)
  File "/usr/local/lib/python3.11/dist-packages/tuned/ppd/controller.py", line 166, in switch_profile
    tuned_profile = self._config.ppd_to_tuned_battery[profile] if self._on_battery else self._config.ppd_to_tuned[profile]
                                                                  ^^^^^^^^^^^^^^^^
AttributeError: 'Controller' object has no attribute '_on_battery'
zacikpa commented 2 weeks ago

Closing this, as it is fixed in #672.