lib/blender/manifest/nodes.rb in server-blender-manifest-0.0.19 vs lib/blender/manifest/nodes.rb in server-blender-manifest-0.1.0
- old
+ new
@@ -38,13 +38,13 @@
current_node == id.to_sym
end
# resolves host name using 'host' executable
# @return host's IP by its name or nil if not found
+ require 'resolv'
def host_ip(name)
return nil unless name && !name.empty?
- res = `host #{name}`.split("\n").grep(/has address/).first
- res && res.split.last
+ Resolv.getaddress(name) rescue nil
end
# define node and conditionally execute code block only on the specific node
# Note: can be called multiple times without internal_name and external_name parameters
# in which case will only do the conditional execution
\ No newline at end of file