forked from dflook/terraform-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from SparkPost/feature/SD-2436
SD-2436 Backport upstream changes to support TF-1.4
- Loading branch information
Showing
6 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/python3 | ||
|
||
import sys | ||
|
||
|
||
def compact_plan(input): | ||
plan = False | ||
buffer = [] | ||
|
||
for line in input: | ||
|
||
if not plan and ( | ||
line.startswith('An execution plan has been generated and is shown below') or | ||
line.startswith('No changes') or | ||
line.startswith('Error') | ||
): | ||
plan = True | ||
|
||
if plan: | ||
yield line | ||
else: | ||
buffer.append(line) | ||
|
||
if not plan and buffer: | ||
yield from buffer | ||
|
||
|
||
if __name__ == '__main__': | ||
for line in compact_plan(sys.stdin.readlines()): | ||
sys.stdout.write(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters