Sha256: d6e2789b7b4c827a165e76ca013ea299121e5e066bf691f7bb8b96e122515f3a

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

module VagrantPlugins
  module CommandServe
    module Service
      class PushService < ProtoService(SDK::PushService::Service)
        def push(req, ctx)
          with_info(ctx, broker: broker) do |info|
            plugin_name = info.plugin_name
            env = mapper.funcspec_map(req, expect: [Vagrant::Environment])

            # Here we are reusing logic from Environment#push, which does the
            # work of looking up the right plugin and scoping down the relevant
            # config from the vagrantfile
            #
            # We are already in a remote lookup loop, so we pass in the local
            # manager to ensure that the local plugin is being looked up.
            env.push(plugin_name, manager: Vagrant.plugin("2").local_manager)

            # The GRPC spec for push plugins has them just returning an empty
            # response on success. The assumption is that they'll print their
            # user feedback directly to the UI as necessary, and they can raise
            # exceptions for error conditions.
            Empty.new
          end
        end

        def push_spec(*_)
          funcspec(
            args: [
              SDK::Args::Project,
            ]
          )
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/commands/serve/service/push_service.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/commands/serve/service/push_service.rb
vagrant-unbundled-2.3.3.0 plugins/commands/serve/service/push_service.rb
vagrant-unbundled-2.3.2.0 plugins/commands/serve/service/push_service.rb