Use __finalized variable to determine finalization

This commit is contained in:
Chris Roberts 2022-06-27 11:26:08 -07:00
parent 70d9fa9faf
commit a2e0c5619e
2 changed files with 5 additions and 5 deletions

View File

@ -26,7 +26,6 @@ module VagrantPlugins
super(
inputs: [
Input.new(type: SDK::FuncSpec::Value) { |arg|
logger.info("funcspec for config merge checking against: #{arg.type}")
arg.type == "hashicorp.vagrant.sdk.Config.Merge" &&
!arg&.value&.value.nil?
}

View File

@ -352,10 +352,11 @@ class Hashicorp::Vagrant::Sdk::Args::ConfigData
instance = klass.new
d = data.to_ruby
# Since we are restoring the config, if the data we have
# is finalized data, finalize the config before we forcibly
# set the instance variables
if d.key?("__service_finalized")
# Since we are restoring the config, if the config this
# represents was already finalized we finalize it first
# before we inject the instance variables to get as close
# to the correct original state as possible
if d.key?("__finalized")
instance.finalize!
instance._finalize!
end