Remove config mappers from provisioner

This commit is contained in:
Chris Roberts 2022-06-13 16:19:51 -07:00
parent a826287f34
commit 0a80ce1ea6

View File

@ -15,35 +15,6 @@ module VagrantPlugins
Client::Provisioner.load(proto, broker: broker)
end
end
class GeneralConfigFromSpec < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: SDK::FuncSpec::Value) { |arg|
arg.type == "hashicorp.vagrant.sdk.Vagrantfile.GeneralConfig" &&
!arg&.value&.value.nil?
}
end
super(inputs: inputs, output: SDK::Vagrantfile::GeneralConfig, func: method(:converter))
end
def converter(proto)
proto.value.unpack(SDK::Vagrantfile::GeneralConfig)
end
end
class ConfigToProto < Mapper
def initialize
inputs = [].tap do |i|
i << Input.new(type: Vagrant::Plugin::V2::Config)
end
super(inputs: inputs, output: SDK::Vagrantfile::GeneralConfig, func: method(:converter))
end
def converter(config)
config.to_proto(config.class.to_s)
end
end
end
end
end