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

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)
This commit is contained in:
Lance Ivy 2014-02-01 22:02:40 -05:00
parent 9fc21f1a57
commit f9a5b9e942
40 changed files with 101 additions and 102 deletions

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:storage, 'atmos/storage', 'Storage')
service(:storage, 'Storage')
end
end

View file

@ -6,28 +6,28 @@ module Fog
module AWS
extend Fog::Provider
service(:auto_scaling, 'aws/auto_scaling', 'AutoScaling')
service(:beanstalk, 'aws/beanstalk', 'ElasticBeanstalk')
service(:cdn, 'aws/cdn', 'CDN')
service(:compute, 'aws/compute', 'Compute')
service(:cloud_formation, 'aws/cloud_formation', 'CloudFormation')
service(:cloud_watch, 'aws/cloud_watch', 'CloudWatch')
service(:data_pipeline, 'aws/data_pipeline', 'DataPipeline')
service(:dynamodb, 'aws/dynamodb', 'DynamoDB')
service(:dns, 'aws/dns', 'DNS')
service(:elasticache, 'aws/elasticache', 'Elasticache')
service(:elb, 'aws/elb', 'ELB')
service(:emr, 'aws/emr', 'EMR')
service(:glacier, 'aws/glacier', 'Glacier')
service(:iam, 'aws/iam', 'IAM')
service(:rds, 'aws/rds', 'RDS')
service(:redshift, 'aws/redshift', 'Redshift')
service(:ses, 'aws/ses', 'SES')
service(:simpledb, 'aws/simpledb', 'SimpleDB')
service(:sns, 'aws/sns', 'SNS')
service(:sqs, 'aws/sqs', 'SQS')
service(:sts, 'aws/sts', 'STS')
service(:storage, 'aws/storage', 'Storage')
service(:auto_scaling, 'AutoScaling')
service(:beanstalk, 'ElasticBeanstalk')
service(:cdn, 'CDN')
service(:compute, 'Compute')
service(:cloud_formation, 'CloudFormation')
service(:cloud_watch, 'CloudWatch')
service(:data_pipeline, 'DataPipeline')
service(:dynamodb, 'DynamoDB')
service(:dns, 'DNS')
service(:elasticache, 'Elasticache')
service(:elb, 'ELB')
service(:emr, 'EMR')
service(:glacier, 'Glacier')
service(:iam, 'IAM')
service(:rds, 'RDS')
service(:redshift, 'Redshift')
service(:ses, 'SES')
service(:simpledb, 'SimpleDB')
service(:sns, 'SNS')
service(:sqs, 'SQS')
service(:sts, 'STS')
service(:storage, 'Storage')
def self.indexed_param(key, values)
params = {}

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'bare_metal_cloud/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,9 +5,9 @@ module Fog
extend Fog::Provider
service(:blb, 'bluebox/blb', 'BLB')
service(:compute, 'bluebox/compute', 'Compute')
service(:dns, 'bluebox/dns', 'DNS')
service(:blb, 'BLB')
service(:compute, 'Compute')
service(:dns, 'DNS')
end
end

View file

@ -4,7 +4,7 @@ module Fog
module Brightbox
extend Fog::Provider
service(:compute, 'brightbox/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'clodo/compute', 'Compute')
service(:compute, 'Compute')
def self.authenticate(options)
clodo_auth_url = options[:clodo_auth_url] || "api.clodo.ru"

View file

@ -4,6 +4,6 @@ module Fog
module CloudSigma
extend Fog::Provider
service(:compute, 'cloudsigma/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -6,7 +6,7 @@ module Fog
extend Fog::Provider
service(:compute, 'cloudstack/compute','Compute')
service(:compute, 'Compute')
@@digest = OpenSSL::Digest.new('sha1')

View file

@ -19,12 +19,11 @@ module Fog
eval(@services_registry[service_key]).new
end
def service(new_service, path, constant_string)
def service(new_service, constant_string)
Fog.services[new_service] ||= []
Fog.services[new_service] |= [self.to_s.split('::').last.downcase.to_sym]
@services_registry ||= {}
@services_registry[new_service] = [self.to_s, constant_string].join('::')
require File.join('fog', path)
end
def services

View file

@ -3,7 +3,7 @@ require 'fog/core'
module Fog
module DigitalOcean
extend Fog::Provider
service(:compute, 'digitalocean/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:dns, 'dnsimple/dns', 'DNS')
service(:dns, 'DNS')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:dns, 'dnsmadeeasy/dns', 'DNS')
service(:dns, 'DNS')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:dns, 'dreamhost/dns', 'DNS')
service(:dns, 'DNS')
end
end

View file

@ -7,7 +7,7 @@ module Fog
module Dynect
extend Fog::Provider
service(:dns, 'dynect/dns', 'DNS')
service(:dns, 'DNS')
class Mock
def self.job_id

View file

@ -6,7 +6,7 @@ module Fog
extend Fog::Provider
service(:compute, 'ecloud/compute', 'Compute')
service(:compute, 'Compute')
def self.keep(hash, *keys)
{}.tap do |kept|

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'glesys/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'go_grid/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,8 +5,8 @@ module Fog
extend Fog::Provider
service(:compute, 'google/compute', 'Compute')
service(:storage, 'google/storage', 'Storage')
service(:compute, 'Compute')
service(:storage, 'Storage')
class Mock

View file

@ -56,14 +56,14 @@ module Fog
end
end
service(:block_storage, 'hp/block_storage', 'BlockStorage')
service(:block_storage_v2, 'hp/block_storage_v2', 'BlockStorageV2')
service(:cdn, 'hp/cdn', 'CDN')
service(:compute, 'hp/compute', 'Compute')
service(:dns, 'hp/dns', 'DNS')
service(:lb, 'hp/lb', 'LB')
service(:network, 'hp/network', 'Network')
service(:storage, 'hp/storage', 'Storage')
service(:block_storage, 'BlockStorage')
service(:block_storage_v2, 'BlockStorageV2')
service(:cdn, 'CDN')
service(:compute, 'Compute')
service(:dns, 'DNS')
service(:lb, 'LB')
service(:network, 'Network')
service(:storage, 'Storage')
# legacy swauth 1.0/1.1 style authentication
def self.authenticate_v1(options, connection_options = {})

View file

@ -5,8 +5,8 @@ module Fog
extend Fog::Provider
service(:compute, 'ibm/compute', 'Compute')
service(:storage, 'ibm/storage', 'Storage')
service(:compute, 'Compute')
service(:storage, 'Storage')
# Provisioning is very slow. We'll pass this arg explicitly until there's a way
# to set the default timeout on a per-provider basis.

View file

@ -12,7 +12,7 @@ module Fog
extend Fog::Provider
service(:storage, 'internet_archive/storage', 'Storage')
service(:storage, 'Storage')
def self.indexed_param(key, values)
params = {}

View file

@ -4,7 +4,7 @@ module Fog
module Joyent
extend Fog::Provider
service(:compute, 'joyent/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'libvirt/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -3,8 +3,8 @@ require 'fog/core'
module Fog
module Linode
extend Fog::Provider
service(:compute, 'linode/compute', 'Compute')
service(:dns, 'linode/dns', 'DNS')
service(:compute, 'Compute')
service(:dns, 'DNS')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:storage, 'local/storage', 'Storage')
service(:storage, 'Storage')
end
end

View file

@ -5,8 +5,8 @@ module Fog
extend Fog::Provider
service(:compute, 'ninefold/compute', 'Compute')
service(:storage, 'ninefold/storage', 'Storage')
service(:compute, 'Compute')
service(:storage, 'Storage')
end
end

View file

@ -41,14 +41,14 @@ module Fog
end
end
service(:compute , 'openstack/compute' , 'Compute' )
service(:image, 'openstack/image', 'Image')
service(:identity, 'openstack/identity', 'Identity')
service(:network, 'openstack/network', 'Network')
service(:storage, 'openstack/storage', 'Storage')
service(:volume, 'openstack/volume', 'Volume')
service(:metering, 'openstack/metering', 'Metering')
service(:orchestration, 'openstack/orchestration', 'Orchestration')
service(:compute , 'Compute')
service(:image, 'Image')
service(:identity, 'Identity')
service(:network, 'Network')
service(:storage, 'Storage')
service(:volume, 'Volume')
service(:metering, 'Metering')
service(:orchestration, 'Orchestration')
def self.authenticate(options, connection_options = {})
case options[:openstack_auth_uri].path

View file

@ -3,7 +3,7 @@ require 'fog/core'
module Fog
module Openvz
extend Fog::Provider
service(:compute, 'openvz/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -11,7 +11,7 @@ module Fog
class NotFound < ServiceError; end
end
service(:compute, 'ovirt/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -84,18 +84,18 @@ module Fog
end
end
service(:auto_scale, 'rackspace/auto_scale', 'AutoScale')
service(:block_storage, 'rackspace/block_storage', 'BlockStorage')
service(:cdn, 'rackspace/cdn', 'CDN')
service(:compute, 'rackspace/compute', 'Compute')
service(:compute_v2, 'rackspace/compute_v2', 'Compute v2')
service(:dns, 'rackspace/dns', 'DNS')
service(:storage, 'rackspace/storage', 'Storage')
service(:load_balancers, 'rackspace/load_balancers', 'LoadBalancers')
service(:identity, 'rackspace/identity', 'Identity')
service(:databases, 'rackspace/databases', 'Databases')
service(:monitoring, 'rackspace/monitoring', 'Monitoring')
service(:queues, 'rackspace/queues', 'Queues')
service(:auto_scale, 'AutoScale')
service(:block_storage, 'BlockStorage')
service(:cdn, 'CDN')
service(:compute, 'Compute')
service(:compute_v2, 'Compute v2')
service(:dns, 'DNS')
service(:storage, 'Storage')
service(:load_balancers, 'LoadBalancers')
service(:identity, 'Identity')
service(:databases, 'Databases')
service(:monitoring, 'Monitoring')
service(:queues, 'Queues')
def self.authenticate(options, connection_options = {})
rackspace_auth_url = options[:rackspace_auth_url]

View file

@ -115,8 +115,8 @@ module Fog
extend Fog::Provider
service(:provisioning, 'riakcs/provisioning', 'Provisioning')
service(:usage, 'riakcs/usage', 'Usage')
service(:provisioning, 'Provisioning')
service(:usage, 'Usage')
end
end

View file

@ -4,7 +4,7 @@ module Fog
module Serverlove
extend Fog::Provider
service(:compute, 'serverlove/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,15 +5,15 @@ module Fog
extend Fog::Provider
service(:compute, 'storm_on_demand/compute', 'Compute')
service(:network, 'storm_on_demand/network', 'Network')
service(:storage, 'storm_on_demand/storage', 'Storage')
service(:dns, 'storm_on_demand/dns', 'DNS')
service(:billing, 'storm_on_demand/billing', 'Billing')
service(:monitoring, 'storm_on_demand/monitoring', 'Monitoring')
service(:support, 'storm_on_demand/support', 'Support')
service(:account, 'storm_on_demand/account', 'Account')
service(:vpn, 'storm_on_demand/vpn', 'VPN')
service(:compute, 'Compute')
service(:network, 'Network')
service(:storage, 'Storage')
service(:dns, 'DNS')
service(:billing, 'Billing')
service(:monitoring, 'Monitoring')
service(:support, 'Support')
service(:account, 'Account')
service(:vpn, 'VPN')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'vcloud/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -62,6 +62,6 @@ module Fog
class TaskError < ServiceError; end
end
service(:compute, 'vcloud_director/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:compute, 'vmfusion/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -6,7 +6,7 @@ module Fog
extend Fog::Provider
service(:compute, 'voxel/compute', 'Compute')
service(:compute, 'Compute')
def self.create_signature(secret, options)
to_sign = options.keys.map { |k| k.to_s }.sort.map { |k| "#{k}#{options[k.to_sym]}" }.join("")

View file

@ -11,7 +11,7 @@ module Fog
class NotFound < ServiceError; end
end
service(:compute, 'vsphere/compute', 'Compute')
service(:compute, 'Compute')
end
end

View file

@ -9,7 +9,7 @@ module Fog
extend Fog::Provider
service(:compute, 'xenserver/compute', 'Compute')
service(:compute, 'Compute')
class Connection
require 'xmlrpc/client'

View file

@ -5,7 +5,7 @@ module Fog
extend Fog::Provider
service(:dns, 'zerigo/dns', 'DNS')
service(:dns, 'DNS')
end
end