python-terraform icon indicating copy to clipboard operation
python-terraform copied to clipboard

import method fails due to being reserved keyword

Open mschuchard opened this issue 5 years ago • 1 comments

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()

mschuchard avatar Jun 12 '20 13:06 mschuchard

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)

viniciuscoelho avatar Jun 25 '20 22:06 viniciuscoelho