Skip to content

Commit

Permalink
Save IP and MAC returned from CloudStack in the foreman host.
Browse files Browse the repository at this point in the history
  • Loading branch information
dra committed Jun 11, 2015
1 parent 65963f8 commit 43701a6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions app/models/concerns/fog_extensions/cloudstack/server.rb
Expand Up @@ -20,21 +20,21 @@ def to_s
name
end

def ip_address
logger.info "BG inspect nics:"
logger.info nics.inspect
return nics[0]["ipaddress"]
end

def test_method
nics[0]["ipaddress"]
end
def ip_address
nics[0]["ipaddress"]
end

def ip_addresses
nics.map { |n| n.ipaddress }
end

def mac_address
nics[0]["macaddress"]
end

def ip_addresses
logger.info "BG inspect nics:"
logger.info nics.inspect
nics.map { |n| n.ipaddress }
end
def mac_addresses
nics.map { |n| n.macaddress }
end

def start
if state.downcase == 'paused'
Expand Down
2 changes: 1 addition & 1 deletion app/models/foreman_cpp_cloudstack/cloudstack.rb
Expand Up @@ -119,7 +119,7 @@ def get_hypervisor
end

def provided_attributes
super.merge({ :ip => :test_method })
super.merge({ :ip => :ip_address, :mac => :mac_address })
end

def self.model_name
Expand Down

0 comments on commit 43701a6

Please sign in to comment.