Skip to content

Commit

Permalink
Update tf-plan.py
Browse files Browse the repository at this point in the history
  • Loading branch information
guptamukul-google committed Nov 15, 2021
1 parent 5775812 commit ec4320b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/tf-plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,13 @@ def tf(dir):
return_code_plan, stdout_plan, stderr_plan = tr.plan_cmd(capture_output=False,var={'billing_account_id':'ABCD-EFGH-IJKL-MNOP', 'organization_id':'1234567890', 'random_id': '1234'})

if(return_code_init == 1):
comment = 'Terraform Init FAILED!\nFor Module: ' + dir.replace(os.getenv('TERRAFORM_CLI_PATH')+'/', '')
comment = 'Terraform Init FAILED for: **' + dir.replace(os.getcwd()+'/temp/', '' +'** !')
status = 'fail'
if(return_code_plan == 1):
comment = 'Terraform Plan FAILED!\nFor Module: ' + dir.replace(os.getenv('TERRAFORM_CLI_PATH')+'/', '')
comment = 'Terraform Plan FAILED for: **' + dir.replace(os.getcwd()+'/temp/', '' +'** !')
status = 'fail'
else:
comment = 'Terraform Init & Terraform Plan SUCCESSFUL!\nFor Module: ' + dir.replace(os.getenv('TERRAFORM_CLI_PATH')+'/', '')
status = 'pass'
comment = 'Terraform Init & Terraform Plan SUCCESSFUL for: **' + dir.replace(os.getcwd()+'/temp/', '' +'** !')

return comment, status

Expand Down

0 comments on commit ec4320b

Please sign in to comment.