Merge remote-tracking branch 'origin/master' into merge-master-into-ci.next

* origin/master:
  Added IP lookup functionality for /vm/hostname (#154)
  Add info about vmfloaty
  Improved tests for vmpooler (#152)
This commit is contained in:
Josh Cooper 2016-07-08 11:50:16 -07:00
commit 28e84e542d
12 changed files with 952 additions and 1000 deletions

View file

@ -457,6 +457,15 @@ module Vmpooler
result[params[:hostname]]['disk'] = rdata['disk'].split(':')
end
# Look up IP address of the hostname
begin
ipAddress = TCPSocket.gethostbyname(params[:hostname])[3]
rescue
ipAddress = ""
end
result[params[:hostname]]['ip'] = ipAddress
if config['domain']
result[params[:hostname]]['domain'] = config['domain']
end