1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #468 from mirell/master

VirtualBox/CLI Improvements
This commit is contained in:
Wesley Beary 2011-08-15 07:09:19 -07:00
commit ad25715e1b
4 changed files with 10 additions and 4 deletions

View file

@ -5,7 +5,11 @@ require 'yaml'
Fog.credential = ARGV.first ? ARGV.first.to_sym : nil
Fog.mock! if ENV['FOG_MOCK']
if Fog.credentials.empty?
Fog::Errors.missing_credentials
begin
Fog::Errors.missing_credentials
rescue Fog::Errors::LoadError => error
abort error.message
end
end
require 'fog/bin'

View file

@ -53,7 +53,7 @@ Gem::Specification.new do |s|
s.add_development_dependency('rdoc')
s.add_development_dependency('rspec', '~>1.3.1')
s.add_development_dependency('shindo', '~>0.3.4')
s.add_development_dependency('virtualbox', '~>0.8.3')
s.add_development_dependency('virtualbox', '~>0.9.1')
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {spec,tests}/*`.split("\n")

View file

@ -44,7 +44,7 @@ module Fog
when :vcloud
require 'fog/compute/vcloud'
Fog::Vcloud::Compute.new(attributes)
when 'VirtualBox'
when :virtualbox
require 'fog/compute/virtual_box'
Fog::Compute::VirtualBox.new(attributes)
when :voxel

View file

@ -16,6 +16,8 @@ module Fog
class NotFound < Fog::Errors::Error; end
class LoadError < LoadError; end
# @return [String] The error message that will be raised, if credentials cannot be found
def self.missing_credentials
missing_credentials_message = <<-YML
@ -68,7 +70,7 @@ An alternate file may be used by placing its path in the FOG_RC environment vari
#######################################################
YML
raise(LoadError.new(missing_credentials_message))
raise(Fog::Errors::LoadError.new(missing_credentials_message))
end
end