summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--cloudinit/ec2_utils.py4
-rw-r--r--tests/unittests/test_merging.py4
3 files changed, 4 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e06578fc..6748e8fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -109,6 +109,7 @@
[Wido den Hollander]
- Paths: fix instance path if datasource's id has a '/'. (LP: #1575938)
[Robert Jennings]
+ - Ec2: do not retry requests for user-data path on 404.
0.7.6:
- open 0.7.6
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',
diff --git a/tests/unittests/test_merging.py b/tests/unittests/test_merging.py
index 681f3780..a33ec184 100644
--- a/tests/unittests/test_merging.py
+++ b/tests/unittests/test_merging.py
@@ -125,9 +125,9 @@ class TestSimpleRun(helpers.ResourceUsingTestCase):
def test_seed_runs(self):
test_dicts = []
- for i in range(1, 50):
+ for i in range(1, 10):
base_dicts = []
- for j in range(1, 50):
+ for j in range(1, 10):
base_dicts.append(make_dict(5, i * j))
test_dicts.append(base_dicts)
for test in test_dicts: