1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-10 01:17:40 +03:00

M #-: refresh Terraform state before destroying (#997)

This commit is contained in:
Alejandro Huertas Herrero 2021-03-18 15:35:59 +01:00 committed by GitHub
parent 8028807600
commit 2dc81c7fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,7 +224,8 @@ module OneProvision
# Destroy
Driver.retry_loop("Driver action 'tf destroy' failed", provision) do
_, e, s = Driver.run(
"cd #{tempdir}; terraform destroy #{target} -auto-approve"
"cd #{tempdir}; terraform refresh; " \
"terraform destroy #{target} -auto-approve"
)
unless s && s.success?