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

Commit 57e9c0f

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

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,14 +984,14 @@ $
984984

985985
### Zone file upload (i.e. import) Python examples (uses BIND format files)
986986

987-
Because `import` is a reserved word in Python there needs to be a slight workaround to calling this within code.
987+
Because `import` is a keyword (or reserved word) in Python we append a '_' (underscore) to the verb in order to use.
988+
The `cli4` command does not need this edit.
988989

989990
```
990991
#
991-
# "import" is a reserved word and hence this code - it's ugly; but correct.
992+
# "import" is a reserved word and hence we add '_' to the end of verb.
992993
#
993-
dns_records_import = getattr(cf.zones.dns_records, 'import')
994-
r = dns_records_import.post(zone_id, files={'file':fd})
994+
r = cf.zones.dns_records.import_.post(zone_id, files={'file':fd})
995995
```
996996

997997
See (examples/example_dns_import.py)[examples/example_dns_import.py] for working code.

0 commit comments

Comments
 (0)