Use Terraspace.tmp_root value instead of hard-coded '/tmp/terraspace' #339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a 🐞 bug fix.
bundle exec rspec
to verify this)Summary
Use Terraspace.tmp_root value instead of hard-coded '/tmp/terraspace'.
Context
This resolves the problems I reported here: #123 (comment)
Terraspace.tmp_root was not being used consistently throughout the terraspace library source.
Which are sub-problems of existing reported issue: #123
How to Test
To test, simply run:
export TS_TMP_ROOT=$HOME/test-foo/ts-tmp
Then, run
terraspace up <stack>
and you should notice all relevant files will be written under the directory specified by the TS_TMP_ROOT environment variable.Previously, some files would have been written under the directory defined by TS_TMP_ROOT and some would have been written under '/tmp/terraspace' which was not expected, consistent behavior.