mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
one server: added interfaces_attributes
This commit is contained in:
parent
b0a1a83745
commit
8df9eb12c5
3 changed files with 23 additions and 7 deletions
|
@ -9,10 +9,8 @@ module Fog
|
|||
identity :id
|
||||
attribute :vnet
|
||||
attribute :model
|
||||
|
||||
def uuid
|
||||
:id
|
||||
end
|
||||
attribute :name
|
||||
attribute :mac
|
||||
|
||||
def initialize attributes = {}
|
||||
super defaults.merge(attributes)
|
||||
|
@ -22,6 +20,10 @@ module Fog
|
|||
raise Fog::Errors::Error.new('Creating a new interface is not yet implemented. Contributions welcome!')
|
||||
end
|
||||
|
||||
def new?
|
||||
mac.nil?
|
||||
end
|
||||
|
||||
def destroy
|
||||
raise Fog::Errors::Error.new('Destroying an interface is not yet implemented. Contributions welcome!')
|
||||
end
|
||||
|
|
|
@ -29,6 +29,15 @@ module Fog
|
|||
#reload
|
||||
end
|
||||
|
||||
def interfaces
|
||||
#[] << Fog::Compute::OpenNebula::Interfaces.new
|
||||
[]
|
||||
end
|
||||
|
||||
def interfaces_attributes=(attributes)
|
||||
true
|
||||
end
|
||||
|
||||
def vm_ip_address
|
||||
ip
|
||||
end
|
||||
|
|
|
@ -49,10 +49,15 @@ module Fog
|
|||
data["cpu"] = temp["VCPU"] unless temp["VCPU"].nil?
|
||||
data["memory"] = temp["MEMORY"] unless temp["MEMORY"].nil?
|
||||
unless (temp["NIC"].nil?) then
|
||||
if one["VM"]["TEMPLATE"]["NIC"].is_a?(Array)
|
||||
data["mac"] = temp["NIC"][0]["MAC"] unless temp["NIC"][0]["MAC"].nil?
|
||||
data["ip"] = temp["NIC"][0]["IP"] unless temp["NIC"][0]["IP"].nil?
|
||||
else
|
||||
data["mac"] = temp["NIC"]["MAC"] unless temp["NIC"]["MAC"].nil?
|
||||
data["ip"] = temp["NIC"]["IP"] unless temp["NIC"]["IP"].nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
data
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue