Closed manniche closed 4 years ago
The list args
in the case of pretf plan -out a_plan
contains only a single element; a_plan
and the reference to the second element will cause an IndexError
The for loop in lines 241-252 will set cmd
to plan
, flags
to ['-out']
and args
to ['a_plan']
, invalidating the assumption in line 274 that len(args)>1
since it holds that len(args)==1
Thanks for the bug report @manniche.
Obviously Pretf shouldn't crash like this but can you try terraform plan -out=a_plan
as per the Terraform docs?
@raymondbutcher Thanks for the quick reply. I was unaware that I had successfully been using the plan -out a_plan
successfully in terraform contrary to what their docs state! But I remember you yourself also mentioning somewhere else that their docs are inconsistent.
pretf plan -out=a_plan
works as expected and as documented by terraform as well. Thanks for the pointer.
With the code currently in master, the logic has been changed to just consume all items of the args
list, so that will fix the issue I have observed. Feel free to close this issue at your leisure.
And thanks for a fantastic piece of software. I have been wanting this for almost a year and have made my own hacks to provide some of the functionality that pretf implements, just not as good as you've done it. Please keep up the good work and feel free to ping me if I can help out with something in the codebase.
Running with terraform 0.12.24 and pretf 0.6.0
When trying to do the equivalent of
terraform plan -out a_plan
, pretf throws anIndexError
: