diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-05-25 10:23:14 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-05-25 10:23:14 -0400 |
commit | 6115beae5f7b87f2dd684deec422f1b21d3cd4eb (patch) | |
tree | b7bad0ac8ee7cd63e6ff94afd3f6e3746fcde6ca /cloudinit | |
parent | fdede2004249a8c0ac302531a5b3bc048458be3d (diff) | |
parent | db54fca319954d72f3fd48eabd27aad8be31e7b3 (diff) | |
download | vyos-cloud-init-6115beae5f7b87f2dd684deec422f1b21d3cd4eb.tar.gz vyos-cloud-init-6115beae5f7b87f2dd684deec422f1b21d3cd4eb.zip |
fix logic error in ec2 get_instance_userdata and slow tests
The change to get_instance_userdata is to fix an issue that
was causing retry in the test when it was not desired.
if user_data returned 404 it means "there was no user-data", so
dont bother retrying. However, _skip_retry_on_codes was returning
False indicating that readurl should retry.
test_merging was creating 2500 random tests, shrink that down to 100.
test_seed_runs is still on my system the slowest test, but
taking < .5 seconds where it was taking > 3.
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/ec2_utils.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cloudinit/ec2_utils.py b/cloudinit/ec2_utils.py index 37b92a83..76dda042 100644 --- a/cloudinit/ec2_utils.py +++ b/cloudinit/ec2_utils.py @@ -144,9 +144,7 @@ def _skip_retry_on_codes(status_codes, _request_args, cause): """Returns if a request should retry based on a given set of codes that case retrying to be stopped/skipped. """ - if cause.code in status_codes: - return False - return True + return cause.code in status_codes def get_instance_userdata(api_version='latest', |