fog-core 2.2.0 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fcacc9e6414f43350224925a67a7adba9395451d04271991aa7163f6abe92ec
4
- data.tar.gz: 88e60a9bf166a5a8814071684e753d5b9c06787c0a6c53e6f7c51754c0c4efe5
3
+ metadata.gz: bf5282b4a064dccd00331a96b041d338ca5dc5da63536e3531809fecb0d73377
4
+ data.tar.gz: df4d83502273c8645ba207081f4e6099f68157c2eac464c294f16bd2195dd2f5
5
5
  SHA512:
6
- metadata.gz: 07bc031a55c69e26ca52b09081aa9c29354504725ed7a9c34c6ef2a2bf9d5d9cbd87bb8bed1b10fcdeaff2640e7ff81324d0ae4f01d32e85bb0ac48742470cfd
7
- data.tar.gz: ed8e334529667209327093cb3a5f4cc1e1cb892c5f1b41ad7468d91c27f5220c6cee83dc4ae4d2da9ef36f7359ca6fc72edc3bf8fd2863cb2f291124ae39c51c
6
+ metadata.gz: b9e19b1e44512d4ac2c6b3cb01ec78fd9b9027fdfc5dbab5d8d65c4a9c54aee4f86eb939692910018af856dbc84f5025be1e1f5093414127e320758271888627
7
+ data.tar.gz: eb0c9cb1e6c55ff2f53d5b10c01dee467ac685257d5da1a071a85fbfea3e32a73f5403d14e4ffe412a09925584830be422f9b8d8db374ae35ea2e5041ec19487
@@ -0,0 +1,33 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Ruby
24
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
+ # uses: ruby/setup-ruby@v1
27
+ uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
28
+ with:
29
+ ruby-version: 2.6
30
+ - name: Install dependencies
31
+ run: bundle install
32
+ - name: Run tests
33
+ run: bundle exec rake
@@ -1,3 +1,19 @@
1
+ 2.2.3 09/16/2020
2
+ ==========================================================
3
+
4
+ Fix provider lookup to properly symbolize newly underscored names
5
+
6
+ 2.2.2 09/15/2020
7
+ ==========================================================
8
+
9
+ Fix #underscore name to be class method (instead of instance method)
10
+
11
+ 2.2.1 09/15/2020
12
+ ==========================================================
13
+
14
+ - Change to verify_host_key never in ssh/scp if supported
15
+ - Allow either downcased and underscored provider names for broader compatability
16
+
1
17
  2.2.0 12/17/2019
2
18
  ==========================================================
3
19
 
@@ -8,9 +8,22 @@ module Fog
8
8
  end
9
9
 
10
10
  module Provider
11
- def self.extended(base)
12
- provider = base.to_s.split("::").last
13
- Fog.providers[provider.downcase.to_sym] = provider
11
+ class << self
12
+ def extended(base)
13
+ provider = base.to_s.split("::").last
14
+ Fog.providers[provider.downcase.to_sym] = provider
15
+ Fog.providers[underscore_name(provider).to_sym] = provider
16
+ end
17
+
18
+ private
19
+
20
+ def underscore_name(string)
21
+ string.gsub(/::/, '/').
22
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
23
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
24
+ tr("-", "_").
25
+ downcase
26
+ end
14
27
  end
15
28
 
16
29
  def [](service_key)
@@ -64,8 +64,9 @@ module Fog
64
64
 
65
65
  @address = address
66
66
  @username = username
67
- @options = { :paranoid => false, :verify_host_key => false }.merge(options)
67
+ @options = { :paranoid => false, :verify_host_key => :never }.merge(options)
68
68
  @options.delete(:paranoid) if Net::SSH::VALID_OPTIONS.include? :verify_host_key
69
+ @options[:verify_host_key] = false unless Net::SSH::Verifiers.const_defined?(:Never)
69
70
  end
70
71
 
71
72
  def upload(local_path, remote_path, upload_options = {}, &block)
@@ -18,19 +18,20 @@ module Fog
18
18
  end
19
19
 
20
20
  def new(attributes)
21
- attributes = attributes.dup # Prevent delete from having side effects
22
- provider = check_provider_alias(attributes.delete(:provider).to_s.downcase.to_sym)
23
- provider_name = Fog.providers[provider]
21
+ attributes = attributes.dup # Prevent delete from having side effects
22
+ provider = attributes.delete(:provider).to_s.downcase.to_sym
23
+ provider_alias = check_provider_alias(provider)
24
+ provider_name = Fog.providers[provider_alias]
24
25
 
25
- raise ArgumentError, "#{provider} is not a recognized provider" unless providers.include?(provider)
26
+ raise ArgumentError, "#{provider_alias} is not a recognized provider" unless providers.include?(provider) || providers.include?(provider_alias)
26
27
 
27
- require_service_provider_library(service_name.downcase, provider)
28
+ require_service_provider_library(service_name.downcase, provider_alias)
28
29
  spc = service_provider_constant(service_name, provider_name)
29
30
  spc.new(attributes)
30
31
  rescue LoadError, NameError => e # Only rescue errors in finding the libraries, allow connection errors through to the caller
31
- Fog::Logger.warning("Error while loading provider #{provider}: #{e.message}")
32
+ Fog::Logger.warning("Error while loading provider #{provider_alias}: #{e.message}")
32
33
  Fog::Logger.debug("backtrace: #{e.backtrace.join("\n")}")
33
- raise Fog::Service::NotFound, "#{provider} has no #{service_name.downcase} service"
34
+ raise Fog::Service::NotFound, "#{provider_alias} has no #{service_name.downcase} service"
34
35
  end
35
36
 
36
37
  def providers
@@ -116,10 +116,11 @@ module Fog
116
116
 
117
117
  # net-ssh has deprecated :paranoid in favor of :verify_host_key
118
118
  # https://github.com/net-ssh/net-ssh/pull/524
119
- opts = { :paranoid => false, :verify_host_key => false }.merge(options)
119
+ opts = { :paranoid => false, :verify_host_key => :never }.merge(options)
120
120
  if Net::SSH::VALID_OPTIONS.include? :verify_host_key
121
121
  opts.delete(:paranoid)
122
122
  end
123
+ opts[:verify_host_key] = false unless Net::SSH::Verifiers.const_defined?(:Never)
123
124
  opts
124
125
  end
125
126
 
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Core
3
- VERSION = "2.2.0"
3
+ VERSION = "2.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Light
8
8
  - Wesley Beary
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-12-17 00:00:00.000000000 Z
12
+ date: 2020-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -202,6 +202,7 @@ extensions: []
202
202
  extra_rdoc_files: []
203
203
  files:
204
204
  - ".github/stale.yml"
205
+ - ".github/workflows/ruby.yml"
205
206
  - ".gitignore"
206
207
  - ".rubocop.yml"
207
208
  - ".travis.yml"
@@ -320,7 +321,7 @@ homepage: https://github.com/fog/fog-core
320
321
  licenses:
321
322
  - MIT
322
323
  metadata: {}
323
- post_install_message:
324
+ post_install_message:
324
325
  rdoc_options: []
325
326
  require_paths:
326
327
  - lib
@@ -335,8 +336,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
335
336
  - !ruby/object:Gem::Version
336
337
  version: '0'
337
338
  requirements: []
338
- rubygems_version: 3.0.3
339
- signing_key:
339
+ rubygems_version: 3.1.2
340
+ signing_key:
340
341
  specification_version: 4
341
342
  summary: Shared classes and tests for fog providers and services.
342
343
  test_files: