mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
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:
commit
28e84e542d
12 changed files with 952 additions and 1000 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue