Skip to content

Commit

Permalink
fix for erroneous rsync and state error due to missing ip address
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Seifried committed Jan 5, 2021
1 parent 2f45ad1 commit 8772ee9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/vagrant-ovirt4/action/read_ssh_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def read_ssh_info(env)

nics_service = server.nics_service
nics = nics_service.list
ip_addr = nics.collect { |nic_attachment| env[:connection].follow_link(nic_attachment).reported_devices.collect { |dev| dev.ips.collect { |ip| ip.address if ip.version == 'v4' } unless dev.ips.nil? } }.flatten.reject { |ip| ip.nil? }.first rescue nil
ip_addr = nics.collect { |nic_attachment| env[:connection].follow_link(nic_attachment.reported_devices).collect { |dev| dev.ips.collect { |ip| ip.address if ip.version == 'v4' } unless dev.ips.nil? } }.flatten.reject { |ip| ip.nil? }.first rescue nil

# Return the info
# TODO: Some info should be configurable in Vagrantfile
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-ovirt4/action/read_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read_state(env)
end
nics_service = server.nics_service
nics = nics_service.list
ip_addr = nics.collect { |nic_attachment| env[:connection].follow_link(nic_attachment).reported_devices.collect { |dev| dev.ips.collect { |ip| ip.address if ip.version == 'v4' } unless dev.ips.nil? } }.flatten.reject { |ip| ip.nil? }.first rescue nil
ip_addr = nics.collect { |nic_attachment| env[:connection].follow_link(nic_attachment.reported_devices).collect { |dev| dev.ips.collect { |ip| ip.address if ip.version == 'v4' } unless dev.ips.nil? } }.flatten.reject { |ip| ip.nil? }.first rescue nil
unless ip_addr.nil?
env[:ip_address] = ip_addr
@logger.debug("Got output #{env[:ip_address]}")
Expand Down

0 comments on commit 8772ee9

Please sign in to comment.