controller: Proceed with reload even if daemon is not running
To fix rhbz#1774645 and rhbz#1702724, we need to make the
`Controller.reload` operation behave the same as a Tuned restart even
in the case when Tuned is running but no profile is applied. To
achieve that, we must not `return False` from `reload()` when Daemon
is not running.
I'm not aware of any specific purpose the `return False` could serve,
other than perhaps making sure that running reload after `tuned-adm
off` does not result in the recommended profile being applied. This
case is handled in commit 5d8ef2c009, so I think it should be safe
now to drop the `return`.
Resolves: rhbz#1774645
Resolves: rhbz#1702724
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
parent
5d8ef2c009
commit
d545b13dc1
1 changed files with 7 additions and 9 deletions
|
|
@ -132,18 +132,16 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
|
|||
def reload(self, caller = None):
|
||||
if caller == "":
|
||||
return False
|
||||
if not self._daemon.is_running():
|
||||
return False
|
||||
else:
|
||||
if self._daemon.is_running():
|
||||
stop_ok = self.stop()
|
||||
if not stop_ok:
|
||||
return False
|
||||
try:
|
||||
self._daemon.reload_profile_config()
|
||||
except TunedException as e:
|
||||
log.error("Failed to reload Tuned: %s" % e)
|
||||
return False
|
||||
return self.start()
|
||||
try:
|
||||
self._daemon.reload_profile_config()
|
||||
except TunedException as e:
|
||||
log.error("Failed to reload Tuned: %s" % e)
|
||||
return False
|
||||
return self.start()
|
||||
|
||||
def _switch_profile(self, profile_name, manual):
|
||||
was_running = self._daemon.is_running()
|
||||
|
|
|
|||
Loading…
Reference in a new issue