copr-be-dev: at least warn that we re-try the virt-install command
This commit is contained in:
parent
11352fa70e
commit
c792f32ad2
1 changed files with 4 additions and 2 deletions
|
@ -311,12 +311,14 @@ class LibvirtSpawner:
|
||||||
"""
|
"""
|
||||||
Retry command till it succeeds
|
Retry command till it succeeds
|
||||||
"""
|
"""
|
||||||
|
if not exception_message:
|
||||||
|
exception_message = "Command failed"
|
||||||
for _ in range(attempts):
|
for _ in range(attempts):
|
||||||
if not self.call(cmd, stdout=sys.stderr):
|
if not self.call(cmd, stdout=sys.stderr):
|
||||||
return
|
return
|
||||||
|
self.log.warning("%s, retry after %s", exception_message,
|
||||||
|
sleep_seconds)
|
||||||
time.sleep(sleep_seconds)
|
time.sleep(sleep_seconds)
|
||||||
if not exception_message:
|
|
||||||
exception_message = "Command failed"
|
|
||||||
exception_message += f" ({str(cmd)}, attempts={attempts})"
|
exception_message += f" ({str(cmd)}, attempts={attempts})"
|
||||||
raise Exception(exception_message)
|
raise Exception(exception_message)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue