summaryrefslogtreecommitdiff
path: root/lib/chef/train_transport.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/train_transport.rb')
-rw-r--r--lib/chef/train_transport.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/train_transport.rb b/lib/chef/train_transport.rb
index 6a82e8620e..55fc9068fa 100644
--- a/lib/chef/train_transport.rb
+++ b/lib/chef/train_transport.rb
@@ -1,5 +1,5 @@
# Author:: Bryan McLellan <btm@loftninjas.org>
-# Copyright:: Copyright 2018, Chef Software, Inc.
+# Copyright:: Copyright 2018-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -92,6 +92,8 @@ class Chef
end
def self.build_transport(logger = Chef::Log.with_child(subsystem: "transport"))
+ return nil unless Chef::Config.target_mode?
+
# TODO: Consider supporting parsing the protocol from a URI passed to `--target`
#
train_config = {}