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

consolidate MockNotImplemented and move into Errors namespace

This commit is contained in:
geemus 2010-05-26 17:38:23 -07:00
parent fea0e70649
commit 8533cdfecc
70 changed files with 74 additions and 69 deletions

View file

@ -60,6 +60,11 @@ module Fog
raise ArgumentError, "delay must be non-negative" unless new_delay >= 0
@delay = new_delay
end
def self.not_implemented
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
end
end
def self.mock!

View file

@ -37,7 +37,7 @@ module Fog
class Mock
def describe_reserved_instances(reserved_instances_id = {})
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -30,7 +30,7 @@ module Fog
class Mock
def modify_image_attributes(image_id, attribute, operation_type, options = {})
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -47,7 +47,7 @@ module Fog
class Mock
def create_load_balancer(availability_zones, lb_name, listeners)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -30,7 +30,7 @@ module Fog
class Mock
def delete_load_balancer(lb_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -33,7 +33,7 @@ module Fog
class Mock
def deregister_instances_from_load_balancer(instance_ids, lb_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
alias :deregister_instances :deregister_instances_from_load_balancer

View file

@ -34,7 +34,7 @@ module Fog
class Mock
def describe_instance_health(lb_name, instance_ids = [])
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -48,7 +48,7 @@ module Fog
class Mock
def describe_load_balancers(lb_name = [])
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -32,7 +32,7 @@ module Fog
class Mock
def disable_availability_zones_for_load_balancer(availability_zones, lb_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
alias :disable_zones :disable_availability_zones_for_load_balancer

View file

@ -32,7 +32,7 @@ module Fog
class Mock
def enable_availability_zones_for_load_balancer(availability_zones, lb_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
alias :enable_zones :enable_availability_zones_for_load_balancer

View file

@ -33,7 +33,7 @@ module Fog
class Mock
def register_instances_with_load_balancer(instance_ids, lb_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
alias :register_instances :register_instances_with_load_balancer

View file

@ -44,7 +44,7 @@ module Fog
class Mock
def get_bucket_acl(bucket_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -44,7 +44,7 @@ module Fog
class Mock
def get_bucket_logging(bucket_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -74,7 +74,7 @@ module Fog
class Mock
def get_bucket_object_versions(bucket_name, options = {})
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
class Mock
def get_bucket_versioning(bucket_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -55,7 +55,7 @@ module Fog
class Mock
def get_object_acl(bucket_name, object_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -46,7 +46,7 @@ module Fog
class Mock
def get_object_object(bucket_name, object_name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -71,7 +71,7 @@ DATA
class Mock
def put_bucket_acl(bucket_name, acl)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -78,7 +78,7 @@ DATA
class Mock
def put_bucket_logging(bucket_name, logging_status)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -31,7 +31,7 @@ DATA
class Mock
def put_bucket_versioning(bucket_name, status)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -31,7 +31,7 @@ module Fog
class Mock
def select(select_expression, next_token = nil)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -22,7 +22,7 @@ module Fog
class Mock
def delete_container(name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -23,7 +23,7 @@ module Fog
class Mock
def delete_object(container, object)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -48,7 +48,7 @@ module Fog
class Mock
def get_container(container, options = {})
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -38,7 +38,7 @@ module Fog
class Mock
def get_containers(options = {})
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -24,7 +24,7 @@ module Fog
class Mock
def get_object(container, object)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -28,7 +28,7 @@ module Fog
class Mock
def head_container(container)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -25,7 +25,7 @@ module Fog
class Mock
def head_containers
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -23,7 +23,7 @@ module Fog
class Mock
def head_object(container, object)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -22,7 +22,7 @@ module Fog
class Mock
def put_container(name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -25,7 +25,7 @@ module Fog
class Mock
def put_object(container, object, data)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -25,7 +25,7 @@ module Fog
class Mock
def get_flavor_details(flavor_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -26,7 +26,7 @@ module Fog
class Mock
def get_image_details(image_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -23,7 +23,7 @@ module Fog
class Mock
def list_flavors
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -25,7 +25,7 @@ module Fog
class Mock
def list_flavors_detail
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -23,7 +23,7 @@ module Fog
class Mock
def reboot_server(server_id, type)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -39,7 +39,7 @@ module Fog
class Mock
def create_slice(flavor_id, image_id, name)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -35,7 +35,7 @@ module Fog
class Mock
def delete_slice(slice_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -27,7 +27,7 @@ module Fog
class Mock
def get_backups
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -30,7 +30,7 @@ module Fog
class Mock
def get_flavor(flavor_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -27,7 +27,7 @@ module Fog
class Mock
def get_flavors
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -28,7 +28,7 @@ module Fog
class Mock
def get_image(image_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -25,7 +25,7 @@ module Fog
class Mock
def get_images
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -36,7 +36,7 @@ module Fog
class Mock
def get_slice(id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -33,7 +33,7 @@ module Fog
class Mock
def get_slices
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
class Mock
def get_slice(id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -31,7 +31,7 @@ module Fog
end
def run(commands)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -54,7 +54,7 @@ module Fog
module Mock
def add_internet_service(ip_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -54,7 +54,7 @@ module Fog
module Mock
def add_node_service(ip)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -54,7 +54,7 @@ module Fog
module Mock
def create_internet_service(vdc_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -21,7 +21,7 @@ module Fog
module Mock
def delete_internet_service(internet_service_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -21,7 +21,7 @@ module Fog
module Mock
def delete_node_service(node_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -21,7 +21,7 @@ module Fog
module Mock
def delete_public_ip(public_ip_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -21,7 +21,7 @@ module Fog
module Mock
def delete_vapp(vapp_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
module Mock
def deploy_vapp(vapp_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -31,7 +31,7 @@ module Fog
module Mock
def get_catalog(vdc_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
module Mock
def get_catalog_item(catalog_item_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
module Mock
def get_internet_services(vdc_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -30,7 +30,7 @@ module Fog
module Mock
def get_network_ips(network_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -29,7 +29,7 @@ module Fog
module Mock
def get_node_services(vdc_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -32,7 +32,7 @@ module Fog
module Mock
def get_public_ip(public_ip_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -38,7 +38,7 @@ module Fog
module Mock
def get_task(task_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -31,7 +31,7 @@ module Fog
module Mock
def get_tasks_list(tasks_list_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -41,7 +41,7 @@ module Fog
module Mock
def get_vapp(vapp_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
module Mock
def get_vapp_template(vapp_template_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -70,7 +70,7 @@ DATA
module Mock
def instatiate_vapp_template(vapp_template_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
module Mock
def power_off(vapp_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
module Mock
def power_on(vapp_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -34,7 +34,7 @@ module Fog
module Mock
def reset(vapp_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end

View file

@ -23,7 +23,7 @@ module Fog
module Mock
def power_shutdown(vapp_id)
raise Fog::Errors::MockNotImplemented.new("Contributions welcome!")
Fog::Mock.not_implemented
end
end