Skip to content

Instantly share code, notes, and snippets.

@Notalifeform
Last active November 8, 2015 12:55
Show Gist options
  • Save Notalifeform/485eaf2d2d1f5ed2bf4f to your computer and use it in GitHub Desktop.
Save Notalifeform/485eaf2d2d1f5ed2bf4f to your computer and use it in GitHub Desktop.
#(line 252, voor vagrant 1.7.4)
def read_forwarded_ports(uuid=nil, active_only=false)
uuid ||= @uuid
@logger.debug("read_forward_ports: uuid=#{uuid} active_only=#{active_only}")
results = []
current_nic = nil
# eat exceptions if showvminfo breaks
begin
info = execute("showvminfo", uuid, "--machinereadable", retryable: true)
rescue Exception => e
@logger.warn "unable to read ports for ${uuid}"
return []
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment