api: fixed stop method not to require any parameter
Fixes #551 Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
e01ff5db2a
commit
c7a3544fa9
1 changed files with 8 additions and 5 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue