1
0
Fork 0

api: fixed stop method not to require any parameter

Fixes #551

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2023-08-22 17:08:22 +02:00
parent e01ff5db2a
commit c7a3544fa9
No known key found for this signature in database
GPG key ID: D8E1C00E076E840B

View file

@ -122,10 +122,7 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
return False
return self._daemon.start()
@exports.export("", "b")
def stop(self, caller = None, profile_switch = False):
if caller == "":
return False
def _stop(self, profile_switch = False):
if not self._daemon.is_running():
res = True
else:
@ -133,12 +130,18 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
self._timer_store.cancel_all()
return res
@exports.export("", "b")
def stop(self, caller = None):
if caller == "":
return False
return self._stop(profile_switch = False)
@exports.export("", "b")
def reload(self, caller = None):
if caller == "":
return False
if self._daemon.is_running():
stop_ok = self.stop(profile_switch = True)
stop_ok = self._stop(profile_switch = True)
if not stop_ok:
return False
try: