From 01fc2926c9dec74e413565a6c148b047ee7fe3bf Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 9 Aug 2021 16:48:42 -0400 Subject: [PATCH] Save machine index entries remotely --- lib/vagrant/machine_index/remote.rb | 10 ++-------- plugins/commands/serve/client/machine.rb | 5 +++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/vagrant/machine_index/remote.rb b/lib/vagrant/machine_index/remote.rb index df9db5081..5480c2c87 100644 --- a/lib/vagrant/machine_index/remote.rb +++ b/lib/vagrant/machine_index/remote.rb @@ -67,7 +67,8 @@ module Vagrant # @param [Entry] entry # @return [Entry] def set(entry) - entry.remote_machine.save + entry.remote_machine.client.save + entry end def recover(entry) @@ -76,13 +77,6 @@ module Vagrant protected - # Converts a machine index entry to a machine - # - # @param [Vagrant::MachineIndex::Entry] - # @return [Hashicorp::Vagrant::Sdk::Args::Target] - def entry_to_machine(entry) - end - # Converts a machine to a machine index entry # # @param [Hashicorp::Vagrant::Sdk::Args::Target] diff --git a/plugins/commands/serve/client/machine.rb b/plugins/commands/serve/client/machine.rb index 36286b726..7c24fea52 100644 --- a/plugins/commands/serve/client/machine.rb +++ b/plugins/commands/serve/client/machine.rb @@ -24,6 +24,11 @@ module VagrantPlugins SDK::Ref::Machine.new(resource_id: resource_id) end + def save + req = Google::Protobuf::Empty.new + @client.save(req) + end + # @return [String] machine name def get_name req = Google::Protobuf::Empty.new