diff options
author | Bryan McLellan <btm@loftninjas.org> | 2018-10-16 15:05:47 -0400 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2019-05-06 12:56:55 -0400 |
commit | 9d5f5c40362d1fd7b0323cf0880300d6165b3a94 (patch) | |
tree | 2bb91f44829455b5566c0de4ad6bb154dd610e4b /lib/chef/run_context.rb | |
parent | 7560313217c851c5b018b27d6ea4bae8c3af0ff1 (diff) | |
download | chef-9d5f5c40362d1fd7b0323cf0880300d6165b3a94.tar.gz |
Target Mode initial implementation
Signed-off-by: Bryan McLellan <btm@chef.io>
Diffstat (limited to 'lib/chef/run_context.rb')
-rw-r--r-- | lib/chef/run_context.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb index dc322b254f..403a30f6fb 100644 --- a/lib/chef/run_context.rb +++ b/lib/chef/run_context.rb @@ -25,6 +25,7 @@ require "chef/log" require "chef/recipe" require "chef/run_context/cookbook_compiler" require "chef/event_dispatch/events_output_stream" +require "chef/train_transport" require "forwardable" class Chef @@ -590,6 +591,22 @@ class Chef reboot_info.size > 0 end + # Remote transport from Train + # + # @return [Train::Plugins::Transport] The child class for our train transport. + # + def transport + @transport ||= Chef::TrainTransport.build_transport(logger) + end + + # Remote connection object from Train + # + # @return [Train::Plugins::Transport::BaseConnection] + # + def transport_connection + transport.connection + end + # # Create a child RunContext. # @@ -650,6 +667,8 @@ class Chef rest_clean rest_clean= unreachable_cookbook? + transport + transport_connection } def initialize(parent_run_context) |