mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Try a few times
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
374cf24321
commit
e19cf37a61
1 changed files with 11 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import sys
|
||||
import time
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -8,8 +9,16 @@ def pkg_name(salt_call_cli, grains):
|
|||
if sys.platform.startswith("win"):
|
||||
ret = salt_call_cli.run("--local", "winrepo.update_git_repos")
|
||||
assert ret.returncode == 0
|
||||
ret = salt_call_cli.run("--local", "pkg.refresh_db")
|
||||
assert ret.returncode == 0
|
||||
attempts = 3
|
||||
while attempts:
|
||||
attempts -= 1
|
||||
ret = salt_call_cli.run("--local", "pkg.refresh_db")
|
||||
if ret.returncode:
|
||||
time.sleep(5)
|
||||
continue
|
||||
break
|
||||
else:
|
||||
pytest.fail("Failed to run 'pkg.refresh_db' 3 times.")
|
||||
return "putty"
|
||||
elif grains["os_family"] == "RedHat":
|
||||
if grains["os"] == "VMware Photon OS":
|
||||
|
|
Loading…
Add table
Reference in a new issue