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/core.rb
Lance Ivy f9a5b9e942 don't require service when registering it
services will still be required when you:
* require them yourself
* require the entire provider (which requires all services)
2014-02-01 22:02:40 -05:00

31 lines
606 B
Ruby

require 'fog/core'
module Fog
module Ecloud
ECLOUD_OPTIONS = [:ecloud_authentication_method]
extend Fog::Provider
service(:compute, 'Compute')
def self.keep(hash, *keys)
{}.tap do |kept|
keys.each{|k| kept[k]= hash[k] if hash.key?(k)}
end
end
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