mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #30249 from mpreziuso/patch-2
Fixes performance and timeout issues on win_pkg.install
This commit is contained in:
commit
3bd02a898f
1 changed files with 5 additions and 2 deletions
|
@ -14,6 +14,7 @@ import errno
|
|||
import os
|
||||
import locale
|
||||
import logging
|
||||
import time
|
||||
from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module
|
||||
|
||||
# Import third party libs
|
||||
|
@ -695,11 +696,13 @@ def install(name=None, refresh=False, pkgs=None, saltenv='base', **kwargs):
|
|||
new = list_pkgs()
|
||||
tries = 0
|
||||
difference = salt.utils.compare_dicts(old, new)
|
||||
while not all(name in difference for name in changed) and tries <= 1000:
|
||||
while not all(name in difference for name in changed) and tries < 10:
|
||||
time.sleep(3)
|
||||
new = list_pkgs()
|
||||
difference = salt.utils.compare_dicts(old, new)
|
||||
tries += 1
|
||||
if tries == 1000:
|
||||
log.debug("Try {0}".format(tries))
|
||||
if tries == 10:
|
||||
ret['_comment'] = 'Registry not updated.'
|
||||
|
||||
# Compare the software list before and after
|
||||
|
|
Loading…
Add table
Reference in a new issue