From d901cb286bb2870c3918f19bf6f892722846fa76 Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Tue, 13 Nov 2018 18:25:06 +0100 Subject: [PATCH] [#2180] Bump fog-openstack --- Gemfile.lock | 7 ++++--- config/env.example | 3 ++- config/initializers/carrierwave.rb | 20 +++++++++++++++++++- config/secrets.yml | 3 ++- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 13c97e520d3..2901189f9db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -213,15 +213,16 @@ GEM ffi (1.9.25) flipflop (2.4.0) activesupport (>= 4.0) - fog-core (1.45.0) + fog-core (2.1.2) builder excon (~> 0.58) formatador (~> 0.2) + mime-types fog-json (1.2.0) fog-core multi_json (~> 1.10) - fog-openstack (0.1.27) - fog-core (~> 1.45.0) + fog-openstack (1.0.6) + fog-core (~> 2.1) fog-json (>= 1.0) ipaddress (>= 0.8) font-awesome-rails (4.7.0.4) diff --git a/config/env.example b/config/env.example index 815202e99ee..fdfef28c6d1 100644 --- a/config/env.example +++ b/config/env.example @@ -18,7 +18,8 @@ BASIC_AUTH_PASSWORD="" FOG_OPENSTACK_TENANT="" FOG_OPENSTACK_API_KEY="" FOG_OPENSTACK_USERNAME="" -FOG_OPENSTACK_AUTH_URL="" +FOG_OPENSTACK_URL="" +FOG_OPENSTACK_IDENTITY_API_VERSION="" FOG_OPENSTACK_REGION="" FOG_DIRECTORY="" FOG_ENABLED="" diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index d267f6f6490..73298442a4d 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -1,3 +1,20 @@ +module Fog + module ServicesMixin + private + + def require_service_provider_library(service, provider) + # Monkey patch to fix https://github.com/fog/fog/issues/4014 + + # This method exists in fog to load legacy providers that have not yet been extracted to + # their own gem. + # fog-openstack has been extracted to its own gem and does not need this method. + # Furthermore, fog-openstack has recently been refactored in a way that breaks this method. + # + # Therefore, until either fog or fog-openstack fixes the problem, we have to neuter the method. + end + end +end + CarrierWave.configure do |config| # These permissions will make dir and files available only to the user running # the servers @@ -13,7 +30,8 @@ openstack_api_key: Rails.application.secrets.fog[:openstack_api_key], openstack_username: Rails.application.secrets.fog[:openstack_username], openstack_auth_url: Rails.application.secrets.fog[:openstack_auth_url], - openstack_region: Rails.application.secrets.fog[:openstack_region] + openstack_region: Rails.application.secrets.fog[:openstack_region], + openstack_identity_api_version: Rails.application.secrets.fog[:oopenstack_identity_api_version] } end diff --git a/config/secrets.yml b/config/secrets.yml index 5c4ad55982b..ab96f8c0bee 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -37,7 +37,8 @@ defaults: &defaults openstack_tenant: <%= ENV['FOG_OPENSTACK_TENANT'] %> openstack_api_key: <%= ENV['FOG_OPENSTACK_API_KEY'] %> openstack_username: <%= ENV['FOG_OPENSTACK_USERNAME'] %> - openstack_auth_url: <%= ENV['FOG_OPENSTACK_AUTH_URL'] %> + openstack_auth_url: <%= ENV['FOG_OPENSTACK_URL'] %> + openstack_identity_api_version: "<%= ENV['FOG_OPENSTACK_IDENTITY_API_VERSION'] %>" openstack_region: <%= ENV['FOG_OPENSTACK_REGION'] %> directory: <%= ENV['FOG_DIRECTORY'] %> carrierwave: