python-terraform
python-terraform copied to clipboard
import method fails due to being reserved keyword
The import method belonging to the Terraform class cannot be invoked because import is a reserved keyword in Python. Please rename the method to make it useable.
The following will throw a syntax error under any usage because of this (Python 3.6.9 and 2.7.17):
tf = Terraform()
tf.import()
Note: method name same as reserved keyword like import won't be accepted by python interpreter, to be able to call the method, you could call cmd_name by adding _cmd after command name, for example, import here could be called by
from python_terraform import * t = Terraform() return_code, stdout, stderr = t.import_cmd(*arguments, **options)