Skip to content

Commit

Permalink
core: don't replace insecure key on base package [GH-5310]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Nov 19, 2015
1 parent 42d0c36 commit 1a7937e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/vagrant/machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def initialize(name, provider_name, provider_cls, provider_config, provider_opti
# XXX: This is temporary. This will be removed very soon.
if base
@id = name

# For base setups, we don't want to insert the key
@config.ssh.insert_key = false
else
reload
end
Expand Down
9 changes: 9 additions & 0 deletions test/unit/vagrant/machine_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ def new_instance
expect(subject.id).to be_nil
end

describe "as a base" do
let(:base) { true}

it "should not insert key" do
subject = new_instance
expect(subject.config.ssh.insert_key).to be_false
end
end

describe "communicator loading" do
it "doesn't eager load SSH" do
config.vm.communicator = :ssh
Expand Down

1 comment on commit 1a7937e

@stepanzarubin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried this for 1.7.4 but when I build base box from existing one it still inserts insecure_private_key.
Is this supposed to be a final fix of #5186?

Please sign in to comment.