lib/fog/vmfusion/models/compute/servers.rb in fog-1.22.0 vs lib/fog/vmfusion/models/compute/servers.rb in fog-1.22.1
- old
+ new
@@ -2,23 +2,20 @@
require 'fog/vmfusion/models/compute/server'
module Fog
module Compute
class Vmfusion
-
class Servers < Fog::Collection
-
model Fog::Compute::Vmfusion::Server
def all(filter = nil)
-
data = []
states = ::Fission::VM.all_with_status.data
filter = {} if filter.nil?
- unless filter.has_key?(:name)
+ unless filter.key?(:name)
vms=::Fission::VM.all.data
vms.each do |vm|
data << { :raw => { :fission => vm,
:state => states[vm.name] } }
end
@@ -26,16 +23,14 @@
data << { :raw => { :fission => ::Fission::VM.new(filter[:name]),
:state => states[filter[:name]] } }
end
load(data)
-
end
def get(name)
self.all(:name => name).first
end
-
end
end
end
end