summaryrefslogtreecommitdiff
path: root/lib/chef/knife/bootstrap/train_connector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/knife/bootstrap/train_connector.rb')
-rw-r--r--lib/chef/knife/bootstrap/train_connector.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/chef/knife/bootstrap/train_connector.rb b/lib/chef/knife/bootstrap/train_connector.rb
index 40e0c565ee..06bc2ba900 100644
--- a/lib/chef/knife/bootstrap/train_connector.rb
+++ b/lib/chef/knife/bootstrap/train_connector.rb
@@ -36,7 +36,6 @@ class Chef
MKTEMP_NIX_COMMAND = "bash -c 'd=$(mktemp -d ${TMPDIR:-/tmp}/chef_XXXXXX); echo $d'".freeze
def initialize(host_url, default_transport, opts)
-
uri_opts = opts_from_uri(host_url)
uri_opts[:backend] ||= @default_transport
@transport_type = uri_opts[:backend]
@@ -59,12 +58,7 @@ class Chef
# Specifying sudo: false ensures that attempted operations
# don't fail because the mock platform doesn't support sudo
tc = TrainConnector.new(url, protocol, { sudo: false }.merge(opts))
-
- # Don't pull in the platform-specific mixins automatically during connect
- # Otherwise, it will raise since it can't resolve the OS without the mock.
tc.connect!
- # We need to provide this mock before invoking mix_in_target_platform,
- # otherwise it will fail with an unknown OS (since we don't have a real connection).
tc.backend.mock_os(
family: family,
name: name,
@@ -72,7 +66,6 @@ class Chef
arch: arch
)
tc
-
end
def connect!
@@ -174,6 +167,7 @@ class Chef
def train
@train
end
+
def backend
@train.connection
end