Skip to content

Commit

Permalink
Merge pull request avocado-framework#3780 from nanli1/add_not_check_s…
Browse files Browse the repository at this point in the history
…ervice_active_in_restart_service_func

add uncheck service active in restart func
  • Loading branch information
dzhengfy authored Oct 30, 2023
2 parents 291ae9f + 151c8ab commit 824f6a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions virttest/utils_libvirtd.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ def _check_start():
return False
return utils_misc.wait_for(_check_start, timeout=timeout)

def start(self, reset_failed=True):
def start(self, reset_failed=True, wait_for_start=True):
result = []
for daem_item in self.daemons:
if reset_failed:
daem_item.reset_failed()
if not daem_item.start():
return False
result.append(self._wait_for_start())
if wait_for_start:
result.append(self._wait_for_start())
return all(result)

def stop(self):
Expand All @@ -119,14 +120,15 @@ def stop(self):
result.append(daem_item.stop())
return all(result)

def restart(self, reset_failed=True):
def restart(self, reset_failed=True, wait_for_start=True):
result = []
for daem_item in self.daemons:
if reset_failed:
daem_item.reset_failed()
if not daem_item.restart():
return False
result.append(self._wait_for_start())
if wait_for_start:
result.append(self._wait_for_start())
return all(result)

def is_running(self):
Expand Down

0 comments on commit 824f6a0

Please sign in to comment.