summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkyleknap <kyleknap@amazon.com>2014-09-18 13:35:30 -0700
committerkyleknap <kyleknap@amazon.com>2014-09-18 14:05:57 -0700
commit445f6bf3dc1b61477407c375133d8e975564566c (patch)
tree190121f05acaa4ea80d956319c6c5abc179dfc5b
parentd149a870b7315fb663eeffb5d4beba2d841ea3d1 (diff)
downloadboto-445f6bf3dc1b61477407c375133d8e975564566c.tar.gz
Inserted break when iterating Route53 records.
``find_records()`` would iterate through the entire zone even though there were no more matching records since records are returned sorted. Added break statement so iteration stops after there is no more matching records to return.
-rw-r--r--boto/route53/zone.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/boto/route53/zone.py b/boto/route53/zone.py
index 167a0891..b21c8de4 100644
--- a/boto/route53/zone.py
+++ b/boto/route53/zone.py
@@ -233,7 +233,14 @@ class Zone(object):
# name/type for get_all_rrsets sets the starting record; they
# are not a filter
- results = [r for r in returned if r.name == name and r.type == type]
+ results = []
+ for r in returned:
+ if r.name == name and r.type == type:
+ results.append(r)
+ # Is at the end of the list of matched records. No need to continue
+ # since the records are sorted by name and type.
+ else:
+ break
weight = None
region = None