From a081fd27585d1faf34a24e7e0fb02ba22f87b0e7 Mon Sep 17 00:00:00 2001 From: Nick Osborn Date: Thu, 5 Sep 2013 23:52:26 +0100 Subject: [PATCH] [vcloud_director] make available to Fog::Bin --- lib/fog/bin.rb | 1 + lib/fog/bin/vcloud_director.rb | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 lib/fog/bin/vcloud_director.rb diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index cbcd2f5cc..7ee63d118 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -88,6 +88,7 @@ require 'fog/bin/serverlove' require 'fog/bin/stormondemand' require 'fog/bin/terremark' require 'fog/bin/vcloud' +require 'fog/bin/vcloud_director' require 'fog/bin/vmfusion' require 'fog/bin/vsphere' require 'fog/bin/voxel' diff --git a/lib/fog/bin/vcloud_director.rb b/lib/fog/bin/vcloud_director.rb new file mode 100644 index 000000000..50b2f7e71 --- /dev/null +++ b/lib/fog/bin/vcloud_director.rb @@ -0,0 +1,30 @@ +class VcloudDirector < Fog::Bin + class << self + + def class_for(key) + case key + when :compute + Fog::Compute::VcloudDirector + else + raise ArgumentError, "Unrecognized service: #{key}" + end + end + + def [](service) + @@connections ||= Hash.new do |hash, key| + hash[key] = case key + when :compute + Fog::Compute.new(:provider => 'VcloudDirector') + else + raise ArgumentError, "Unrecognized service: #{key.inspect}" + end + end + @@connections[service] + end + + def services + Fog::VcloudDirector.services + end + + end +end