Set plugin name

This commit is contained in:
sophia 2022-02-10 10:34:49 -06:00 committed by Paul Hinze
parent 1217189616
commit 153d218d68
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
4 changed files with 21 additions and 3 deletions

View File

@ -160,6 +160,12 @@ func (m *Machine) Guest() (g core.Guest, err error) {
// TODO(spox): Fix this in the plugin manager
m.seedPlugin(result)
m.guest = result
if named, ok := result.(core.Named); ok {
named.SetPluginName(result_name)
if err != nil {
return nil, err
}
}
g = result
return result, nil
}

View File

@ -38,8 +38,6 @@ module Vagrant
#
# @param [Symbol] cap_name Name of the capability
def capability(cap_name, *args)
@logger.debug("running name just 'cause:")
@logger.debug("neam is: #{name}")
@logger.debug("running remote guest capability #{cap_name} with args #{args}")
if !client.has_capability?(cap_name)
raise Errors::GuestCapabilityNotFound,

View File

@ -23,7 +23,7 @@ module VagrantPlugins
# @return [String] plugin name
def name
c = client.name(Empty.new)
c = client.plugin_name(Empty.new)
c.name
end
end

View File

@ -83,6 +83,20 @@ module VagrantPlugins
end
end
def set_plugin_name(req, ctx)
logger.debug("setting plugin name to nothing 'cause i don't care")
Empty.new
end
def plugin_name(req, ctx)
with_info(ctx, broker: broker) do |info|
logger.debug("returning plugin name #{info.plugin_name}")
SDK::PluginInfo::Name.new(
name: info.plugin_name
)
end
end
def capability_arguments(args)
target, direct = args
nargs = direct.args.dup