Clean up and add some logging output
This commit is contained in:
parent
6be33f1f84
commit
c6c7455c8e
@ -36,6 +36,7 @@ module VagrantPlugins
|
||||
|
||||
# @param [Symbol] cap_name Name of the capability
|
||||
def capability(cap_name, *args)
|
||||
logger.debug("executing capability #{cap_name}")
|
||||
arg_protos = seeds.map do |any|
|
||||
SDK::FuncSpec::Value.new(
|
||||
name: "",
|
||||
|
||||
@ -85,9 +85,11 @@ module VagrantPlugins
|
||||
|
||||
def capability(req, ctx)
|
||||
with_info(ctx) do |info|
|
||||
logger.debug("executing capability, got req #{req}")
|
||||
cap_name = req.name.to_sym
|
||||
plugin_name = info.plugin_name.to_sym
|
||||
|
||||
logger.debug("executing capability #{cap_name} on plugin #{plugin_name}")
|
||||
|
||||
caps_registry = capabilities[plugin_name]
|
||||
target_cap = caps_registry.get(cap_name)
|
||||
|
||||
|
||||
@ -18,7 +18,6 @@ module VagrantPlugins
|
||||
def command_info(req, ctx)
|
||||
with_info(ctx) do |info|
|
||||
command_info = collect_command_info(info.plugin_name, [])
|
||||
logger.info("command info, #{command_info}")
|
||||
SDK::Command::CommandInfoResp.new(
|
||||
command_info: command_info,
|
||||
)
|
||||
@ -85,7 +84,7 @@ module VagrantPlugins
|
||||
protected
|
||||
|
||||
def collect_command_info(plugin_name, subcommand_names)
|
||||
logger.info("collecting command information for #{plugin_name} #{subcommand_names}")
|
||||
logger.debug("collecting command information for #{plugin_name} #{subcommand_names}")
|
||||
options = command_options_for(plugin_name, subcommand_names)
|
||||
if options.nil?
|
||||
hlp_msg = ""
|
||||
@ -131,17 +130,17 @@ module VagrantPlugins
|
||||
end
|
||||
|
||||
def get_subcommands(plugin_name, subcommand_names)
|
||||
logger.info("collecting subcommands for #{plugin_name} #{subcommand_names}")
|
||||
logger.debug("collecting subcommands for #{plugin_name} #{subcommand_names}")
|
||||
subcommands = []
|
||||
cmds = subcommands_for(plugin_name, subcommand_names)
|
||||
if !cmds.nil?
|
||||
logger.info("found subcommands #{cmds.keys}")
|
||||
logger.debug("found subcommands #{cmds.keys}")
|
||||
cmds.keys.each do |subcmd|
|
||||
subnms = subcommand_names.dup
|
||||
subcommands << collect_command_info(plugin_name, subnms.append(subcmd.to_s))
|
||||
end
|
||||
else
|
||||
logger.info("no subcommands found")
|
||||
logger.debug("no subcommands found")
|
||||
end
|
||||
return subcommands
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user