Skip to content

Commit afc1822

Browse files
committed
Sleep between connection attempts
1 parent 9280a22 commit afc1822

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugins/module_utils/base.py

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import json
1010
import os
1111

12+
from time import sleep
13+
1214
from ansible.module_utils.basic import env_fallback
1315
from ansible.module_utils.common.text.converters import jsonify
1416
from ansible.module_utils.six.moves.urllib.error import (
@@ -168,6 +170,7 @@ def _open_url(self, path, method, data=None, fatal=True):
168170

169171
except ConnectionError as e:
170172
if attempt < 5:
173+
sleep(attempt)
171174
continue
172175
if self._module:
173176
failure = {

0 commit comments

Comments
 (0)