Skip to content

Commit e961e03

Browse files
committed
Merge pull request #6 from KyeRussell/master
bugfix: exception raised when zone had no records
2 parents 9990553 + 6e97b20 commit e961e03

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pyflare/client.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ def rec_load_all(self, zone):
6969
'o': current_count,
7070
'z': zone
7171
})
72-
has_more = records['response']['recs']['has_more']
73-
current_count += records['response']['recs']['count']
74-
for record in records['response']['recs']['objs']:
75-
yield record
72+
try:
73+
has_more = records['response']['recs']['has_more']
74+
current_count += records['response']['recs']['count']
75+
for record in records['response']['recs']['objs']:
76+
yield record
77+
except KeyError:
78+
has_more = False
7679

7780
def zone_check(self, zones):
7881
"""

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='pyflare',
9-
version='1.1.1',
9+
version='1.1.2',
1010
packages=packages,
1111
url='https://github.com/jlinn/pyflare',
1212
license='LICENSE.txt',

0 commit comments

Comments
 (0)