1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/openstack/models/compute/host.rb
Paul Thornthwaite 2e0b7e545a Standardise empty lines throughout codebase
Done with `rubocop --auto-correct --only EmptyLineBetweenDefs,EmptyLines,EmptyLinesAroundBody`
2014-05-26 14:20:02 +01:00

28 lines
716 B
Ruby

require 'fog/compute/models/server'
require 'fog/openstack/models/compute/metadata'
module Fog
module Compute
class OpenStack
class Host < Fog::Model
attribute :host_name
attribute :service_name
attribute :details
attribute :zone
def initialize(attributes)
attributes["service_name"] = attributes.delete "service"
# Old 'connection' is renamed as service and should be used instead
prepare_service_value(attributes)
super
end
def details
service.get_host_details(self.host_name).body['host']
rescue Fog::Compute::OpenStack::NotFound
nil
end
end
end
end
end