mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Added IP lookup functionality for /vm/hostname (#154)
This commit is contained in:
parent
19c4bfa34b
commit
4e2a1fb62c
1 changed files with 9 additions and 0 deletions
|
|
@ -459,6 +459,15 @@ module Vmpooler
|
||||||
result[params[:hostname]]['disk'] = rdata['disk'].split(':')
|
result[params[:hostname]]['disk'] = rdata['disk'].split(':')
|
||||||
end
|
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']
|
if config['domain']
|
||||||
result[params[:hostname]]['domain'] = config['domain']
|
result[params[:hostname]]['domain'] = config['domain']
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue