Skip to content

Commit

Permalink
updated to handle new keyword handling method
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Dec 21, 2023
1 parent d7ca6d1 commit 6769d9f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions examples/example_dns_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ def main():

zone_id = zones[0]['id']

#
# "import" is a reserved word and hence this code - it's ugly; but correct.
#
m = cf.zones.dns_records
m = getattr(m, 'import')

try:
r = m.post(zone_id, files={'file':fd})
#
# "import" is a reserved word and hence we add '_' to the end of verb.
#
r = cf.zones.dns_records.import_.post(zone_id, files={'file':fd})
except CloudFlare.exceptions.CloudFlareAPIError as e:
exit('/zones/dns_records/import %s - %d %s - api call failed' % (dns_name, e, e))

Expand Down

0 comments on commit 6769d9f

Please sign in to comment.