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

Refactor to remove service_type param from provider call.

This commit is contained in:
Rupak Ganguly 2012-01-24 16:33:46 -05:00
parent 68f4776afd
commit 36bb238685
4 changed files with 8 additions and 9 deletions

View file

@ -67,7 +67,7 @@ module Fog
@hp_account_id = options[:hp_account_id]
@hp_secret_key = options[:hp_secret_key]
@hp_tenant_id = options[:hp_tenant_id]
@hp_service_type = options[:hp_service_type] || "object-store"
@hp_service_type = options[:hp_service_type]
### Decide which auth style to use
unless (@hp_use_upass_auth_style)

View file

@ -6,7 +6,7 @@ module Fog
class HP < Fog::Service
requires :hp_secret_key, :hp_account_id
recognizes :hp_auth_uri, :hp_cdn_uri, :persistent, :connection_options, :hp_use_upass_auth_style, :hp_tenant_id, :hp_service_type, :hp_auth_version
recognizes :hp_auth_uri, :hp_cdn_uri, :persistent, :connection_options, :hp_use_upass_auth_style, :hp_tenant_id, :hp_auth_version
model_path 'fog/hp/models/cdn'
@ -64,7 +64,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service type for object storage to the authentication call
options[:hp_service_type] ||= "hpext:cdn"
options[:hp_service_type] = "hpext:cdn"
### Make the authentication call
if (auth_version == :v2)

View file

@ -6,7 +6,7 @@ module Fog
class HP < Fog::Service
requires :hp_secret_key, :hp_account_id
recognizes :hp_auth_uri, :hp_servicenet, :persistent, :connection_options, :hp_use_upass_auth_style, :hp_tenant_id, :hp_service_type
recognizes :hp_auth_uri, :hp_servicenet, :persistent, :connection_options, :hp_use_upass_auth_style, :hp_tenant_id, :hp_auth_version
model_path 'fog/hp/models/compute'
model :address
@ -114,7 +114,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service type for compute via the options hash
options[:hp_service_type] ||= "compute"
options[:hp_service_type] = "compute"
@hp_tenant_id = options[:hp_tenant_id]
### Make the authentication call

View file

@ -6,7 +6,7 @@ module Fog
class HP < Fog::Service
requires :hp_secret_key, :hp_account_id
recognizes :hp_auth_uri, :hp_servicenet, :hp_cdn_ssl, :hp_cdn_uri, :persistent, :connection_options, :hp_use_upass_auth_style, :hp_tenant_id, :hp_service_type, :hp_auth_version
recognizes :hp_auth_uri, :hp_servicenet, :hp_cdn_ssl, :hp_cdn_uri, :persistent, :connection_options, :hp_use_upass_auth_style, :hp_tenant_id, :hp_auth_version
model_path 'fog/hp/models/storage'
model :directory
@ -36,8 +36,7 @@ module Fog
:hp_secret_key => @hp_secret_key,
:hp_auth_uri => @hp_auth_uri,
:hp_cdn_uri => @hp_cdn_uri,
:hp_tenant_id => @hp_tenant_id,
:hp_service_type => "hpext:cdn"
:hp_tenant_id => @hp_tenant_id
)
if @cdn.enabled?
@cdn
@ -148,7 +147,7 @@ module Fog
### Set an option to use the style of authentication desired; :v1 or :v2 (default)
auth_version = options[:hp_auth_version] || :v2
### Pass the service type for object storage to the authentication call
options[:hp_service_type] ||= "object-store"
options[:hp_service_type] = "object-store"
@hp_tenant_id = options[:hp_tenant_id]
### Make the authentication call