deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/2] git commit: Core: Rename ExceptionHandler to Exceptions
Date Thu, 11 Oct 2012 11:08:14 GMT
Core: Rename ExceptionHandler to Exceptions

* Just a cosmetic change, the exceptions looks better ;-)

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/c08e3f09d368e3e99274dd89b04500ccd8e58d54


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/adade324
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/adade324
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/adade324

Branch: refs/heads/master
Commit: adade32451815c8ee28e29be35636bd0f98473fc
Parents: 74f3ef3
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Mon Oct 8 16:12:34 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Thu Oct 11 13:07:16 2012 +0200

----------------------------------------------------------------------
 server/lib/cimi/collections/base.rb                |    2 +-
 server/lib/deltacloud/collections/base.rb          |    2 +-
 server/lib/deltacloud/collections/firewalls.rb     |    4 +-
 server/lib/deltacloud/drivers/base_driver.rb       |    2 +-
 .../lib/deltacloud/drivers/condor/condor_driver.rb |    2 +-
 server/lib/deltacloud/drivers/exceptions.rb        |   22 +++++++-------
 .../drivers/openstack/openstack_driver.rb          |    8 +++---
 .../drivers/terremark/terremark_driver.rb          |    2 +-
 server/lib/deltacloud/helpers/deltacloud_helper.rb |    6 ++--
 server/tests/drivers/base/exceptions_test.rb       |   16 +++++-----
 server/tests/drivers/ec2/buckets_test.rb           |    2 +-
 server/tests/drivers/ec2/images_test.rb            |    2 +-
 server/tests/drivers/ec2/instance_test.rb          |    2 +-
 server/tests/drivers/ec2/keys_test.rb              |    4 +-
 server/tests/drivers/ec2/realms_test.rb            |    2 +-
 server/tests/drivers/ec2/storage_snapshots_test.rb |    2 +-
 .../tests/drivers/gogrid/hardware_profiles_test.rb |    2 +-
 server/tests/drivers/gogrid/images_test.rb         |    2 +-
 server/tests/drivers/gogrid/instances_test.rb      |    2 +-
 server/tests/drivers/gogrid/realms_test.rb         |    2 +-
 server/tests/drivers/mock/images_test.rb           |    4 +-
 server/tests/drivers/mock/instances_test.rb        |    2 +-
 server/tests/drivers/mock/keys_test.rb             |    4 +-
 server/tests/drivers/mock/realms_test.rb           |    2 +-
 .../tests/drivers/mock/storage_snapshots_test.rb   |    2 +-
 server/tests/drivers/mock/storage_volumes_test.rb  |    2 +-
 .../drivers/openstack/hardware_profiles_test.rb    |    2 +-
 server/tests/drivers/openstack/images_test.rb      |    2 +-
 server/tests/drivers/openstack/instances_test.rb   |    2 +-
 server/tests/drivers/openstack/keys_test.rb        |    4 +-
 server/tests/drivers/openstack/realms_test.rb      |    2 +-
 server/tests/drivers/rhevm/images_test.rb          |    4 +-
 server/tests/drivers/rhevm/instance_test.rb        |    4 +-
 server/tests/drivers/rhevm/provider_test.rb        |    2 +-
 server/tests/drivers/rhevm/realms_test.rb          |    2 +-
 35 files changed, 64 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/cimi/collections/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/base.rb b/server/lib/cimi/collections/base.rb
index c1fad3d..a78b78a 100644
--- a/server/lib/cimi/collections/base.rb
+++ b/server/lib/cimi/collections/base.rb
@@ -47,7 +47,7 @@ module CIMI::Collections
       report_error
     end
 
-    error Deltacloud::ExceptionHandler::ValidationFailure do
+    error Deltacloud::Exceptions::ValidationFailure do
       report_error
     end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/collections/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/base.rb b/server/lib/deltacloud/collections/base.rb
index 203b558..21a7e98 100644
--- a/server/lib/deltacloud/collections/base.rb
+++ b/server/lib/deltacloud/collections/base.rb
@@ -43,7 +43,7 @@ module Deltacloud::Collections
       report_error
     end
 
-    error Deltacloud::ExceptionHandler::ValidationFailure do
+    error Deltacloud::Exceptions::ValidationFailure do
       report_error
     end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/collections/firewalls.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/firewalls.rb b/server/lib/deltacloud/collections/firewalls.rb
index 47ab68f..3066c1b 100644
--- a/server/lib/deltacloud/collections/firewalls.rb
+++ b/server/lib/deltacloud/collections/firewalls.rb
@@ -99,8 +99,8 @@ module Deltacloud::Collections
           params['addresses'] = addresses
           params['groups'] = groups
           if addresses.empty? && groups.empty?
-            raise Deltacloud::ExceptionHandler::ValidationFailure.new(
-              StandardError.new("No sources. Specify at least one source ip_address or group")
+            raise Deltacloud::Exceptions.exception_from_status(
+              400, 'No sources. Specify at least one source ip address or group.'
             )
           end
           driver.create_firewall_rule(credentials, params)

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/drivers/base_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/base_driver.rb b/server/lib/deltacloud/drivers/base_driver.rb
index 34c561c..cfb689d 100644
--- a/server/lib/deltacloud/drivers/base_driver.rb
+++ b/server/lib/deltacloud/drivers/base_driver.rb
@@ -23,7 +23,7 @@ module Deltacloud
 
   class BaseDriver
 
-    include ExceptionHandler
+    include Exceptions
 
     STATE_MACHINE_OPTS = {
       :all_states => [:start, :pending, :running, :stopping, :stopped, :finish],

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/drivers/condor/condor_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/condor/condor_driver.rb b/server/lib/deltacloud/drivers/condor/condor_driver.rb
index b0564f9..d3477b3 100644
--- a/server/lib/deltacloud/drivers/condor/condor_driver.rb
+++ b/server/lib/deltacloud/drivers/condor/condor_driver.rb
@@ -192,7 +192,7 @@ module Deltacloud
 
         def new_client(credentials)
           if ( credentials.user != 'condor' ) or ( credentials.password != 'deltacloud' )
-            raise Deltacloud::ExceptionHandler::AuthenticationFailure.new
+            raise Deltacloud::Exceptions::AuthenticationFailure.new
           end
           safely do
             yield CondorCloud::DefaultExecutor.new

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/drivers/exceptions.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/exceptions.rb b/server/lib/deltacloud/drivers/exceptions.rb
index c855129..0664c5f 100644
--- a/server/lib/deltacloud/drivers/exceptions.rb
+++ b/server/lib/deltacloud/drivers/exceptions.rb
@@ -15,7 +15,7 @@
 #
 
 module Deltacloud
-  module ExceptionHandler
+  module Exceptions
 
     class DeltacloudException < StandardError
 
@@ -143,16 +143,16 @@ module Deltacloud
       def handler(e)
         return @handler if @handler
         case @status
-          when 401 then Deltacloud::ExceptionHandler::AuthenticationFailure.new(e, @message)
-          when 403 then Deltacloud::ExceptionHandler::ForbiddenError.new(e, @message)
-          when 404 then Deltacloud::ExceptionHandler::ObjectNotFound.new(e, @message)
-          when 406 then Deltacloud::ExceptionHandler::UnknownMediaTypeError.new(e, @message)
-          when 405 then Deltacloud::ExceptionHandler::MethodNotAllowed.new(e, @message)
-          when 400 then Deltacloud::ExceptionHandler::ValidationFailure.new(e, @message)
-          when 500 then Deltacloud::ExceptionHandler::BackendError.new(e, @message)
-          when 501 then Deltacloud::ExceptionHandler::NotImplemented.new(e, @message)
-          when 502 then Deltacloud::ExceptionHandler::ProviderError.new(e, @message)
-          when 504 then Deltacloud::ExceptionHandler::ProviderTimeout.new(e, @message)
+          when 401 then AuthenticationFailure.new(e, @message)
+          when 403 then ForbiddenError.new(e, @message)
+          when 404 then ObjectNotFound.new(e, @message)
+          when 406 then UnknownMediaTypeError.new(e, @message)
+          when 405 then MethodNotAllowed.new(e, @message)
+          when 400 then ValidationFailure.new(e, @message)
+          when 500 then BackendError.new(e, @message)
+          when 501 then NotImplemented.new(e, @message)
+          when 502 then ProviderError.new(e, @message)
+          when 504 then ProviderTimeout.new(e, @message)
         end
       end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
index 86d6983..04bd409 100644
--- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
+++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
@@ -44,8 +44,8 @@ module Deltacloud
           #get the collections as defined by 'capability' and 'respond_to?' blocks
           super_collections = super
           begin
-             client = new_client(credentials, :buckets)
-          rescue Deltacloud::ExceptionHandler::NotImplemented #OpenStack::Exception::NotImplemented...
+             new_client(credentials, :buckets)
+          rescue Deltacloud::Exceptions::NotImplemented #OpenStack::Exception::NotImplemented...
              return super_collections - [Sinatra::Rabbit::BucketsCollection]
           end
           super_collections
@@ -110,8 +110,8 @@ module Deltacloud
           begin
             image = os.get_image(image_id)
             image.delete!
-          rescue => e
-            raise Deltacloud::ExceptionHandler::BackendError.new(e, "ERROR: Cannot delete
image with ID:#{image_id}.")
+          rescue
+            raise Deltacloud::Exceptions.exception_from_status(500, "Cannot delete image
with id #{image_id}")
           end
         end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/drivers/terremark/terremark_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/terremark/terremark_driver.rb b/server/lib/deltacloud/drivers/terremark/terremark_driver.rb
index 3260c47..1d3f4ce 100644
--- a/server/lib/deltacloud/drivers/terremark/terremark_driver.rb
+++ b/server/lib/deltacloud/drivers/terremark/terremark_driver.rb
@@ -139,7 +139,7 @@ VAPP_STATE_MAP = { "0" =>  "PENDING", "1" =>  "PENDING", "2" =>
 "STOPPED", "4"
     end
     unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&
               (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then
-        raise Deltacloud::ExceptionHandler::ValidationFailure.new(
+        raise Deltacloud::Exceptions::ValidationFailure.new(
           StandardError.new("Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]}
and mem->#{opts[:hwp_memory]}")
         )
     end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/lib/deltacloud/helpers/deltacloud_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb
index 4c433c5..a03a413 100644
--- a/server/lib/deltacloud/helpers/deltacloud_helper.rb
+++ b/server/lib/deltacloud/helpers/deltacloud_helper.rb
@@ -81,15 +81,15 @@ module Deltacloud::Helpers
       end
     end
 
+    # Log errors to the same logger as we use for logging requests
     def log
-      Deltacloud::ExceptionHandler.logger(Deltacloud.default_frontend.logger)
+      Deltacloud::Exceptions.logger(Deltacloud.default_frontend.logger)
     end
 
     def report_error(code=nil)
-      handler = Deltacloud::ExceptionHandler
 
       if !code.nil?
-        @error = handler.exception_from_status(code, translate_error_code(code)[:message])
+        @error = Deltacloud::Exceptions.exception_from_status(code, translate_error_code(code)[:message])
         @code = code
         message = @error.message
       else

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/base/exceptions_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/base/exceptions_test.rb b/server/tests/drivers/base/exceptions_test.rb
index 479627d..bfd476e 100644
--- a/server/tests/drivers/base/exceptions_test.rb
+++ b/server/tests/drivers/base/exceptions_test.rb
@@ -6,7 +6,7 @@ require_relative '../../../lib/deltacloud/drivers/exceptions'
 class TestException < StandardError; end
 
 class ExceptionTestClass
-  include Deltacloud::ExceptionHandler
+  include Deltacloud::Exceptions
 
   def raise_exception(id)
     case id
@@ -30,12 +30,12 @@ end
 
 def raise_error(id); ExceptionTestClass.new.raise_exception(id); end
 
-describe Deltacloud::ExceptionHandler do
+describe Deltacloud::Exceptions do
 
   it 'should capture exception when match the exception message' do
-    lambda { raise_error 1 }.must_raise Deltacloud::ExceptionHandler::BackendError
+    lambda { raise_error 1 }.must_raise Deltacloud::Exceptions::BackendError
 
-    begin raise_error(1); rescue Deltacloud::ExceptionHandler::BackendError => e
+    begin raise_error(1); rescue Deltacloud::Exceptions::BackendError => e
       e.code.must_equal 500
       e.message.must_equal 'Test1ErrorMessage'
       e.backtrace.wont_be_empty
@@ -44,8 +44,8 @@ describe Deltacloud::ExceptionHandler do
   end
 
   it 'should capture exception when match the exception class' do
-    lambda { raise_error 2 }.must_raise Deltacloud::ExceptionHandler::ValidationFailure
-    begin raise_error(2); rescue Deltacloud::ExceptionHandler::ValidationFailure => e
+    lambda { raise_error 2 }.must_raise Deltacloud::Exceptions::ValidationFailure
+    begin raise_error(2); rescue Deltacloud::Exceptions::ValidationFailure => e
       e.code.must_equal 400
       e.message.must_equal 'StandardErrorTest'
       e.backtrace.wont_be_empty
@@ -53,8 +53,8 @@ describe Deltacloud::ExceptionHandler do
   end
 
   it 'should capture exception when no match found' do
-    lambda { raise_error 3 }.must_raise Deltacloud::ExceptionHandler::BackendError
-    begin raise_error(3); rescue Deltacloud::ExceptionHandler::BackendError => e
+    lambda { raise_error 3 }.must_raise Deltacloud::Exceptions::BackendError
+    begin raise_error(3); rescue Deltacloud::Exceptions::BackendError => e
       e.code.must_equal 500
       e.message.must_equal 'Unhandled exception or status code (not captured)'
       e.backtrace.wont_be_empty

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/ec2/buckets_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/buckets_test.rb b/server/tests/drivers/ec2/buckets_test.rb
index bf058ba..b19b866 100644
--- a/server/tests/drivers/ec2/buckets_test.rb
+++ b/server/tests/drivers/ec2/buckets_test.rb
@@ -24,7 +24,7 @@ describe 'Ec2Driver Buckets' do
   it 'must throw error when wrong credentials for buckets' do
     Proc.new do
       @driver.backend.buckets(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/ec2/images_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/images_test.rb b/server/tests/drivers/ec2/images_test.rb
index 31823a3..857ede7 100644
--- a/server/tests/drivers/ec2/images_test.rb
+++ b/server/tests/drivers/ec2/images_test.rb
@@ -17,7 +17,7 @@ describe 'Ec2Driver Images' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of images' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/ec2/instance_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/instance_test.rb b/server/tests/drivers/ec2/instance_test.rb
index 2cbf848..2492f08 100644
--- a/server/tests/drivers/ec2/instance_test.rb
+++ b/server/tests/drivers/ec2/instance_test.rb
@@ -17,7 +17,7 @@ describe 'Ec2Driver Instances' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of instances' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/ec2/keys_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/keys_test.rb b/server/tests/drivers/ec2/keys_test.rb
index ca2ab62..e8c659c 100644
--- a/server/tests/drivers/ec2/keys_test.rb
+++ b/server/tests/drivers/ec2/keys_test.rb
@@ -17,7 +17,7 @@ describe 'Ec2Driver Keys' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of keys' do
@@ -44,7 +44,7 @@ describe 'Ec2Driver Keys' do
     key = @driver.create_key(:key_name => 'test-key-1')
     key.wont_be_nil
     key.must_be_kind_of Key
-    Proc.new { @driver.create_key(:key_name => 'test-key-1') }.must_raise Deltacloud::ExceptionHandler::ProviderError,
'KeyExist'
+    Proc.new { @driver.create_key(:key_name => 'test-key-1') }.must_raise Deltacloud::Exceptions::ProviderError,
'KeyExist'
     @driver.destroy_key :id => key.id
     @driver.key(:id => key.id).must_be_nil
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/ec2/realms_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/realms_test.rb b/server/tests/drivers/ec2/realms_test.rb
index 0f0b7d2..eb5ab1f 100644
--- a/server/tests/drivers/ec2/realms_test.rb
+++ b/server/tests/drivers/ec2/realms_test.rb
@@ -17,7 +17,7 @@ describe 'Ec2Driver Realms' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of realms' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/ec2/storage_snapshots_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/ec2/storage_snapshots_test.rb b/server/tests/drivers/ec2/storage_snapshots_test.rb
index 06f0ce0..0ac66d5 100644
--- a/server/tests/drivers/ec2/storage_snapshots_test.rb
+++ b/server/tests/drivers/ec2/storage_snapshots_test.rb
@@ -16,7 +16,7 @@ describe 'Ec2Driver StorageSnapshots' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of storage snapshots' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/gogrid/hardware_profiles_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/gogrid/hardware_profiles_test.rb b/server/tests/drivers/gogrid/hardware_profiles_test.rb
index 67bb9a7..353c4c2 100644
--- a/server/tests/drivers/gogrid/hardware_profiles_test.rb
+++ b/server/tests/drivers/gogrid/hardware_profiles_test.rb
@@ -17,7 +17,7 @@ describe 'GoGrid Hardware Profiles' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of hardware profiles' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/gogrid/images_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/gogrid/images_test.rb b/server/tests/drivers/gogrid/images_test.rb
index ccc478c..d2078ea 100644
--- a/server/tests/drivers/gogrid/images_test.rb
+++ b/server/tests/drivers/gogrid/images_test.rb
@@ -17,7 +17,7 @@ describe 'GoGridDriver Images' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of images' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/gogrid/instances_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/gogrid/instances_test.rb b/server/tests/drivers/gogrid/instances_test.rb
index 52e8e13..092c8b7 100644
--- a/server/tests/drivers/gogrid/instances_test.rb
+++ b/server/tests/drivers/gogrid/instances_test.rb
@@ -58,7 +58,7 @@ describe 'GoGridDriver Instances' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of instances' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/gogrid/realms_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/gogrid/realms_test.rb b/server/tests/drivers/gogrid/realms_test.rb
index 442fae5..a810992 100644
--- a/server/tests/drivers/gogrid/realms_test.rb
+++ b/server/tests/drivers/gogrid/realms_test.rb
@@ -17,7 +17,7 @@ describe 'GoGridDriver Realms' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of realms' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/mock/images_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/images_test.rb b/server/tests/drivers/mock/images_test.rb
index 2958ef9..3f72e03 100644
--- a/server/tests/drivers/mock/images_test.rb
+++ b/server/tests/drivers/mock/images_test.rb
@@ -12,7 +12,7 @@ describe 'MockDriver Images' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of images' do
@@ -43,7 +43,7 @@ describe 'MockDriver Images' do
     @driver.image(:id => 'img1-test').id.must_equal 'img1-test'
     @driver.image(:id => 'img1-test').name.must_equal 'img1-test'
     @driver.image(:id => 'img1-test').description.must_equal 'Test1'
-    Proc.new { @driver.create_image(:id => 'unknown-instance', :name => 'test') }.must_raise
Deltacloud::ExceptionHandler::BackendError, 'CreateImageNotSupported'
+    Proc.new { @driver.create_image(:id => 'unknown-instance', :name => 'test') }.must_raise
Deltacloud::Exceptions::BackendError, 'CreateImageNotSupported'
     @driver.image(:id => 'test').must_be_nil
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/mock/instances_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/instances_test.rb b/server/tests/drivers/mock/instances_test.rb
index 97ff0ac..4c05136 100644
--- a/server/tests/drivers/mock/instances_test.rb
+++ b/server/tests/drivers/mock/instances_test.rb
@@ -12,7 +12,7 @@ describe 'MockDriver Instances' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.instances(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of instances' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/mock/keys_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/keys_test.rb b/server/tests/drivers/mock/keys_test.rb
index 9deb4c4..ecf7ec8 100644
--- a/server/tests/drivers/mock/keys_test.rb
+++ b/server/tests/drivers/mock/keys_test.rb
@@ -12,7 +12,7 @@ describe 'MockDriver Keys' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.keys(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of keys' do
@@ -39,7 +39,7 @@ describe 'MockDriver Keys' do
     key = @driver.create_key(:key_name => 'test1')
     key.wont_be_nil
     key.must_be_kind_of Key
-    Proc.new { @driver.create_key(:key_name => 'test1') }.must_raise Deltacloud::ExceptionHandler::ForbiddenError,
'KeyExist'
+    Proc.new { @driver.create_key(:key_name => 'test1') }.must_raise Deltacloud::Exceptions::ForbiddenError,
'KeyExist'
     @driver.destroy_key :id => key.id
     @driver.key(:id => key.id).must_be_nil
   end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/mock/realms_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/realms_test.rb b/server/tests/drivers/mock/realms_test.rb
index 3e57398..758fa0d 100644
--- a/server/tests/drivers/mock/realms_test.rb
+++ b/server/tests/drivers/mock/realms_test.rb
@@ -12,7 +12,7 @@ describe 'MockDriver Realms' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of realms' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/mock/storage_snapshots_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/storage_snapshots_test.rb b/server/tests/drivers/mock/storage_snapshots_test.rb
index 8b45fac..b77e6e0 100644
--- a/server/tests/drivers/mock/storage_snapshots_test.rb
+++ b/server/tests/drivers/mock/storage_snapshots_test.rb
@@ -12,7 +12,7 @@ describe 'MockDriver StorageSnapshots' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.storage_snapshots(OpenStruct.new(:user => 'unknown', :password =>
'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of storage_snapshots' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/mock/storage_volumes_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/mock/storage_volumes_test.rb b/server/tests/drivers/mock/storage_volumes_test.rb
index 3cc77b9..1394474 100644
--- a/server/tests/drivers/mock/storage_volumes_test.rb
+++ b/server/tests/drivers/mock/storage_volumes_test.rb
@@ -12,7 +12,7 @@ describe 'MockDriver StorageVolumes' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.storage_volumes(OpenStruct.new(:user => 'unknown', :password =>
'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of storage_volumes' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/openstack/hardware_profiles_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/hardware_profiles_test.rb b/server/tests/drivers/openstack/hardware_profiles_test.rb
index 8c6b0c3..ffee21a 100644
--- a/server/tests/drivers/openstack/hardware_profiles_test.rb
+++ b/server/tests/drivers/openstack/hardware_profiles_test.rb
@@ -17,7 +17,7 @@ describe 'OpenStackDriver HardwareProfiles' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown+wrong', :password =>
'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of hardware_profiles' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/openstack/images_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/images_test.rb b/server/tests/drivers/openstack/images_test.rb
index 5c3d943..7181f7d 100644
--- a/server/tests/drivers/openstack/images_test.rb
+++ b/server/tests/drivers/openstack/images_test.rb
@@ -17,7 +17,7 @@ describe 'OpenStackDriver Images' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown+wrong', :password =>
'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of images' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/openstack/instances_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/instances_test.rb b/server/tests/drivers/openstack/instances_test.rb
index 99ec2b0..e391a2a 100644
--- a/server/tests/drivers/openstack/instances_test.rb
+++ b/server/tests/drivers/openstack/instances_test.rb
@@ -17,7 +17,7 @@ describe 'OpenStackDriver Instances' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown+wrong', :password =>
'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of instances' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/openstack/keys_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/keys_test.rb b/server/tests/drivers/openstack/keys_test.rb
index bb16f09..4e7c7ed 100644
--- a/server/tests/drivers/openstack/keys_test.rb
+++ b/server/tests/drivers/openstack/keys_test.rb
@@ -17,7 +17,7 @@ describe 'OpenStackDriver Keys' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown+wrong', :password =>
'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of keys' do
@@ -54,7 +54,7 @@ describe 'OpenStackDriver Keys' do
     # Should not allow duplicate keys to be created:
     lambda {
       @driver.create_key(:key_name => 'test-unit-1')
-    }.must_raise Deltacloud::ExceptionHandler::BackendError
+    }.must_raise Deltacloud::Exceptions::BackendError
     @driver.destroy_key(:id => 'test-unit-1').must_equal true
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/openstack/realms_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/openstack/realms_test.rb b/server/tests/drivers/openstack/realms_test.rb
index e820f28..96f67b6 100644
--- a/server/tests/drivers/openstack/realms_test.rb
+++ b/server/tests/drivers/openstack/realms_test.rb
@@ -17,7 +17,7 @@ describe 'OpenStackDriver Realms' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown+wrong', :password =>
'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of realms' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/rhevm/images_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/rhevm/images_test.rb b/server/tests/drivers/rhevm/images_test.rb
index 43d06e4..25f8cdb 100644
--- a/server/tests/drivers/rhevm/images_test.rb
+++ b/server/tests/drivers/rhevm/images_test.rb
@@ -17,7 +17,7 @@ describe 'RhevmDriver Images' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of images' do
@@ -57,7 +57,7 @@ describe 'RhevmDriver Images' do
       image.state.must_equal 'OK'
       Proc.new {
         @driver.destroy_image(image.id)
-      }.must_raise Deltacloud::ExceptionHandler::BackendError, 'Cannot delete Template. Template
is being used by the following VMs: test1.'
+      }.must_raise Deltacloud::Exceptions::BackendError, 'Cannot delete Template. Template
is being used by the following VMs: test1.'
     end
   end
 

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/rhevm/instance_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/rhevm/instance_test.rb b/server/tests/drivers/rhevm/instance_test.rb
index 8edf5cb..757ebf0 100644
--- a/server/tests/drivers/rhevm/instance_test.rb
+++ b/server/tests/drivers/rhevm/instance_test.rb
@@ -17,7 +17,7 @@ describe 'RhevmDriver Instances' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.images(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of instances' do
@@ -93,7 +93,7 @@ describe 'RhevmDriver Instances' do
     @driver.start_instance(instance.id)
     instance = instance.wait_for!(@driver, record_retries('start')) { |i| i.is_running? }
     @driver.instance(:id => instance.id).state.must_equal 'RUNNING'
-    Proc.new { @driver.destroy_instance(instance.id) }.must_raise Deltacloud::ExceptionHandler::BackendError,
'Cannot remove VM. VM is running.'
+    Proc.new { @driver.destroy_instance(instance.id) }.must_raise Deltacloud::Exceptions::BackendError,
'Cannot remove VM. VM is running.'
     @driver.stop_instance(instance.id)
     instance = instance.wait_for!(@driver, record_retries('stop')) { |i| i.is_stopped? }
     @driver.instance(:id => instance.id).state.must_equal 'STOPPED'

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/rhevm/provider_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/rhevm/provider_test.rb b/server/tests/drivers/rhevm/provider_test.rb
index 9a9836d..dd42ae3 100644
--- a/server/tests/drivers/rhevm/provider_test.rb
+++ b/server/tests/drivers/rhevm/provider_test.rb
@@ -18,7 +18,7 @@ describe 'RHEV-M provider test' do
     wrong_driver = Deltacloud::new(:rhevm, credentials.merge(:provider => 'unknown'))
     Proc.new {
       wrong_driver.realms
-    }.must_raise Deltacloud::ExceptionHandler::BackendError
+    }.must_raise Deltacloud::Exceptions::BackendError
   end
 
   it 'must support listing of available providers' do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/adade324/server/tests/drivers/rhevm/realms_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/drivers/rhevm/realms_test.rb b/server/tests/drivers/rhevm/realms_test.rb
index 383473c..6edb64d 100644
--- a/server/tests/drivers/rhevm/realms_test.rb
+++ b/server/tests/drivers/rhevm/realms_test.rb
@@ -17,7 +17,7 @@ describe 'RhevmDriver Realms' do
   it 'must throw error when wrong credentials' do
     Proc.new do
       @driver.backend.realms(OpenStruct.new(:user => 'unknown', :password => 'wrong'))
-    end.must_raise Deltacloud::ExceptionHandler::AuthenticationFailure, 'Authentication Failure'
+    end.must_raise Deltacloud::Exceptions::AuthenticationFailure, 'Authentication Failure'
   end
 
   it 'must return list of realms' do


Mime
View raw message