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

fixes 0.12 path.module resolution #71

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

fixes 0.12 path.module resolution #71

wants to merge 1 commit into from

Conversation

jalavoy
Copy link

@jalavoy jalavoy commented Nov 6, 2019

0.12.x changed how ${path.module} is rendered, and since python-terraform isn't explicitly passing a path to the terraform binary, terraform is using the implied value of . instead of the full path cwd.

This patch explicitly passes the path to the terraform binary when Popen() is called, which restores the old behavior in <0.11.x. Basically, it stops chdir() into the terraform root directory and passes the directory to terraform instead.

This was a drop in replacement in my testing that fixed the problem outright. The only other things I had to change in my code were paths being passed to backend_config since terraform is being called from a different directory now (the root of the project rather than the terraform root).

It's very possible this breaks other peoples configurations, and this problem was unique to my workflow. If that's the case feel free to reject the patch. Just passing up what worked for me in case it can help others.

Thank you for your time and attention

@Spikeophant Spikeophant self-requested a review November 6, 2019 19:30
@Spikeophant Spikeophant self-assigned this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants