lib/fog/openstack/volume_v2.rb in fog-openstack-0.1.7 vs lib/fog/openstack/volume_v2.rb in fog-openstack-0.1.8

- old
+ new

@@ -1,7 +1,6 @@ require 'fog/openstack/core' -require 'fog/openstack/common' require 'fog/openstack/volume' module Fog module Volume class OpenStack @@ -137,14 +136,14 @@ end end class Real include Fog::OpenStack::Core + def self.not_found_class Fog::Volume::OpenStack::NotFound end - include Fog::OpenStack::Common def initialize(options = {}) initialize_identity options @openstack_service_type = options[:openstack_service_type] || ['volumev2'] @@ -152,19 +151,22 @@ @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL' @connection_options = options[:connection_options] || {} authenticate + set_api_path + @persistent = options[:persistent] || false + @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) + end + + def set_api_path unless @path.match(SUPPORTED_VERSIONS) @path = Fog::OpenStack.get_supported_version_path(SUPPORTED_VERSIONS, @openstack_management_uri, @auth_token, @connection_options) end - - @persistent = options[:persistent] || false - @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) end end end end end