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/ecloud.rb

32 lines
674 B
Ruby
Raw Normal View History

2012-06-07 12:50:11 -04:00
require(File.expand_path(File.join(File.dirname(__FILE__), 'core')))
module Fog
module Ecloud
2012-11-27 19:57:16 -05:00
ECLOUD_OPTIONS = [:ecloud_authentication_method]
extend Fog::Provider
service(:compute, 'ecloud/compute', 'Compute')
2012-11-27 19:57:16 -05:00
def self.keep(hash, *keys)
{}.tap do |kept|
keys.each{|k| kept[k]= hash[k] if hash.key?(k)}
end
end
2012-11-27 19:57:16 -05:00
def self.slice(hash, *keys)
hash.dup.tap do |sliced|
keys.each{|k| sliced.delete(k)}
end
end
def self.ip_address
4.times.map{ Fog::Mock.random_numbers(3) }.join(".")
end
def self.mac_address
6.times.map{ Fog::Mock.random_numbers(2) }.join(":")
end
end
end