From 84b9b1650a3833272f03ef9b24d4f54a853869ad Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Fri, 29 Oct 2021 08:58:40 -0700 Subject: [PATCH] Add client access to ui --- lib/vagrant/ui.rb | 13 +++++++++++++ lib/vagrant/ui/remote.rb | 2 ++ 2 files changed, 15 insertions(+) diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 16bb28890..4ed4614c4 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -83,6 +83,11 @@ module Vagrant def rewriting yield self end + + def to_proto + raise NotImplementedError, + "Vagrant::UI::Interface#to_proto" + end end # This is a UI implementation that does nothing. @@ -296,6 +301,14 @@ module Vagrant @ui = ui end + def to_proto + @ui.to_proto + end + + def client + @ui.client + end + def initialize_copy(original) super @ui = original.instance_variable_get(:@ui).dup diff --git a/lib/vagrant/ui/remote.rb b/lib/vagrant/ui/remote.rb index 0a888f1ab..328da79e8 100644 --- a/lib/vagrant/ui/remote.rb +++ b/lib/vagrant/ui/remote.rb @@ -1,6 +1,8 @@ module Vagrant module UI class Remote < Basic + attr_reader :client + def initialize(client) super() @client = client