This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
997997See (examples/example_dns_import.py)[ examples/example_dns_import.py] for working code.
You can’t perform that action at this time.
0 commit comments