tuned-adm: Fix profile_info crash when no profile is active
If Tuned is running without any profile applied (e.g. after running 'tuned-adm off'), then 'tuned-adm profile_info' crashes with the following error: 2020-06-08 17:24:11,998 ERROR dbus.connection: Unable to set arguments (None,) according to signature 's': <class 'TypeError'>: Expected a string or unicode object ERROR:dbus.connection:Unable to set arguments (None,) according to signature 's': <class 'TypeError'>: Expected a string or unicode object dbus[25054]: arguments to dbus_message_get_destination() were incorrect, assertion "message != NULL" failed in file ../../dbus/dbus-message.c line 3678. This is normally a bug in some application using the D-Bus library. D-Bus not built with -rdynamic so unable to print a backtrace Aborted (core dumped) To fix it, detect that no profile is applied and print the same message as in _action_profile_info in this case. Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
parent
4eebe5f295
commit
eccaf795b9
1 changed files with 6 additions and 1 deletions
|
|
@ -149,7 +149,12 @@ class Admin(object):
|
|||
def _action_dbus_profile_info(self, profile = ""):
|
||||
if profile == "":
|
||||
profile = self._dbus_get_active_profile()
|
||||
return self._controller.exit(self._print_profile_info(profile, self._controller.profile_info(profile)))
|
||||
if profile:
|
||||
res = self._print_profile_info(profile, self._controller.profile_info(profile))
|
||||
else:
|
||||
print("No current active profile.")
|
||||
res = False
|
||||
return self._controller.exit(res)
|
||||
|
||||
def _action_profile_info(self, profile = ""):
|
||||
if profile == "":
|
||||
|
|
|
|||
Loading…
Reference in a new issue