From f183a8a81008b063783cad520cc3a7718d71b4e7 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Tue, 22 Feb 2022 11:39:25 -0800 Subject: [PATCH] Update provisioner service implementation --- .../serve/service/provisioner_service.rb | 58 +++++-------------- 1 file changed, 13 insertions(+), 45 deletions(-) diff --git a/plugins/commands/serve/service/provisioner_service.rb b/plugins/commands/serve/service/provisioner_service.rb index 582ffcd57..b21441ecf 100644 --- a/plugins/commands/serve/service/provisioner_service.rb +++ b/plugins/commands/serve/service/provisioner_service.rb @@ -1,14 +1,7 @@ module VagrantPlugins module CommandServe module Service - class ProvisionerService < Hashicorp::Vagrant::Sdk::ProvisionerService::Service - prepend Util::HasMapper - prepend Util::HasBroker - prepend Util::HasLogger - - include Util::ServiceInfo - include Util::HasSeeds::Service - include Util::ExceptionTransformer + class ProvisionerService < ProtoService(SDK::ProvisionerService::Service) def cleanup(req, ctx) machine, plugin_config = _process_args(req) @@ -19,19 +12,11 @@ module VagrantPlugins end def cleanup_spec(*_) - SDK::FuncSpec.new( - name: "cleanup_spec", + funcspec( args: [ - SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Target.Machine", - name: "", - ), - SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Vagrantfile.GeneralConfig", - name: "", - ) - ], - result: [], + SDK::Args::Target::Machine, + SDK::Vagrantfile::GeneralConfig, + ] ) end @@ -46,23 +31,14 @@ module VagrantPlugins end def configure_spec(*_) - SDK::FuncSpec.new( - name: "configure_spec", + funcspec( args: [ - SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Target.Machine", - name: "", - ), - SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Vagrantfile.GeneralConfig", - name: "", - ) - ], - result: [], + SDK::Args::Target::Machine, + SDK::Vagrantfile::GeneralConfig, + ] ) end - def provision(req, ctx) machine, plugin_config = _process_args(req) @@ -74,19 +50,11 @@ module VagrantPlugins end def provision_spec(*_) - SDK::FuncSpec.new( - name: "provision_spec", + funcspec( args: [ - SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Args.Target.Machine", - name: "", - ), - SDK::FuncSpec::Value.new( - type: "hashicorp.vagrant.sdk.Vagrantfile.GeneralConfig", - name: "", - ) - ], - result: [], + SDK::Args::Target::Machine, + SDK::Vagrantfile::GeneralConfig, + ] ) end