Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 6769d9f

Browse files
committed
updated to handle new keyword handling method
1 parent d7ca6d1 commit 6769d9f

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

examples/example_dns_import.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,11 @@ def main():
4242

4343
zone_id = zones[0]['id']
4444

45-
#
46-
# "import" is a reserved word and hence this code - it's ugly; but correct.
47-
#
48-
m = cf.zones.dns_records
49-
m = getattr(m, 'import')
50-
5145
try:
52-
r = m.post(zone_id, files={'file':fd})
46+
#
47+
# "import" is a reserved word and hence we add '_' to the end of verb.
48+
#
49+
r = cf.zones.dns_records.import_.post(zone_id, files={'file':fd})
5350
except CloudFlare.exceptions.CloudFlareAPIError as e:
5451
exit('/zones/dns_records/import %s - %d %s - api call failed' % (dns_name, e, e))
5552

0 commit comments

Comments
 (0)