Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import method fails due to being reserved keyword #87

Open
mschuchard opened this issue Jun 12, 2020 · 1 comment
Open

import method fails due to being reserved keyword #87

mschuchard opened this issue Jun 12, 2020 · 1 comment

Comments

@mschuchard
Copy link

mschuchard commented Jun 12, 2020

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()
@viniciuscoelho
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants