Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
Access IP address using VM provider API, the same way as `vagrant ssh…
Browse files Browse the repository at this point in the history
…` does.

Calling a code within guest VM can give different results, i.e. issues with `docker0` interface registered as a first network adapter.
  • Loading branch information
Michael Kuzmin committed Apr 28, 2015
1 parent c9153c0 commit 9c2f68e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.synopsis

def execute
with_target_vms(nil, {:single_target=>true}) do |machine|
ip = machine.guest.capability(:read_ip_address)
ip = machine.provider.capability(:public_address)
message = ENV['TEAMCITY_VERSION'] ? "##teamcity[setParameter name='env.VAGRANT_GUESTIP' value='#{ip}']" : ip
@env.ui.info(message)
end
Expand Down
2 changes: 1 addition & 1 deletion vagrant-guestip.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'vagrant-guestip'
spec.version = '0.2'
spec.version = '0.3.pre1'
spec.authors = ['Michael Kuzmin']
spec.email = ['[email protected]']
spec.summary = 'Vagrant plugin for obtaining IP address of a guest machine'
Expand Down

0 comments on commit 9c2f68e

Please sign in to comment.