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

M #-: add file exist check in Terraform state (#854)

This commit is contained in:
Alejandro Huertas Herrero 2021-02-22 18:26:46 +01:00 committed by GitHub
parent ce6dae6163
commit 5359b5c548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,9 +151,13 @@ module OneProvision
)
unless s && s.success?
@state = File.read("#{tempdir}/terraform.tfstate")
conf = Base64.encode64(Zlib::Deflate.deflate(@conf))
state = Base64.encode64(Zlib::Deflate.deflate(@state))
conf = Base64.encode64(Zlib::Deflate.deflate(@conf))
state = ''
if File.exist?("#{tempdir}/terraform.tfstate")
@state = File.read("#{tempdir}/terraform.tfstate")
state = Base64.encode64(Zlib::Deflate.deflate(@state))
end
provision.add_tf(state, conf)