Method: CORL::Plugin::Network#local_node

Defined in:
lib/core/plugin/network.rb

#local_node(require_new = false) ⇒ Object




195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/core/plugin/network.rb', line 195

def local_node(require_new = false)
  ip_address = CORL.public_ip  
  local_node = node_by_ip(ip_address, require_new)
  
  if local_node.nil?
    name       = Util::Data.ensure_value(lookup(:fqdn), ip_address)
    local_node = CORL.node(name, extended_config(:local_node).import({ :meta => { :parent => myself }}), :local) 
  else
    local_node.network = myself
    local_node.normalize(true)
    local_node.localize               
  end
  local_node
end