(command_string, max_attempts=1, delay=5, target_rc=0)
| 31 | |
| 32 | |
| 33 | def _aws(command_string, max_attempts=1, delay=5, target_rc=0): |
| 34 | service = command_string.split()[0] |
| 35 | env = None |
| 36 | if service in REGION_OVERRIDES: |
| 37 | env = os.environ.copy() |
| 38 | env['AWS_REGION'] = REGION_OVERRIDES[service] |
| 39 | |
| 40 | for _ in range(max_attempts - 1): |
| 41 | result = aws(command_string, env_vars=env) |
| 42 | if result.rc == target_rc: |
| 43 | return result |
| 44 | time.sleep(delay) |
| 45 | return aws(command_string, env_vars=env) |
| 46 | |
| 47 | |
| 48 | @pytest.mark.parametrize('cmd', COMMANDS) |
no test coverage detected