Skip to content

Commit 654c293

Browse files
jetteroroot
authored and
root
committed
provide a way to mock a slowdown result
1 parent 3020f21 commit 654c293

File tree

1 file changed

+6
-0
lines changed
  • hubblestack/extmods/utils

1 file changed

+6
-0
lines changed

hubblestack/extmods/utils/s3.py

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
HAS_REQUESTS = False # pylint: disable=W0612
1818

1919
# Import Salt libs
20+
import os
2021
import salt.utils.aws
2122
import salt.utils.files
2223
import salt.utils.hashutils
@@ -203,6 +204,11 @@ def query(key, keyid, method='GET', params=None, headers=None,
203204
err_code = 'http-{0}'.format(result.status_code)
204205
err_msg = err_text
205206

207+
if os.environ.get('MOCK_SLOW_DOWN'):
208+
result.status_code = 503
209+
err_code = 'SlowDown'
210+
err_msg = 'slow down you jerks'
211+
206212
log.debug('S3 Response Status Code: %s', result.status_code)
207213

208214
if method == 'PUT':

0 commit comments

Comments
 (0)