fog-core 2.1.1 → 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 +4 -4
- data/.github/workflows/ruby.yml +33 -0
- data/Rakefile +2 -2
- data/changelog.md +40 -0
- data/fog-core.gemspec +1 -1
- data/lib/fog/core/provider.rb +26 -4
- data/lib/fog/core/scp.rb +2 -1
- data/lib/fog/core/services_mixin.rb +29 -9
- data/lib/fog/core/ssh.rb +3 -2
- data/lib/fog/core/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf5282b4a064dccd00331a96b041d338ca5dc5da63536e3531809fecb0d73377
|
4
|
+
data.tar.gz: df4d83502273c8645ba207081f4e6099f68157c2eac464c294f16bd2195dd2f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/Rakefile
CHANGED
data/changelog.md
CHANGED
@@ -1,3 +1,43 @@
|
|
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
|
+
|
17
|
+
2.2.0 12/17/2019
|
18
|
+
==========================================================
|
19
|
+
|
20
|
+
- Add explanation for service/provider format deprecation.
|
21
|
+
- Fix formatting of changelog
|
22
|
+
- Better logging around required providers for easier debugging.
|
23
|
+
- bump excon version
|
24
|
+
- add bundler gem tasks
|
25
|
+
|
26
|
+
2.1.2 09/04/2018
|
27
|
+
==========================================================
|
28
|
+
|
29
|
+
- fix typo in ssh options handling
|
30
|
+
|
31
|
+
2.1.1 09/04/2018
|
32
|
+
==========================================================
|
33
|
+
|
34
|
+
- deprecate attributes not defined by DSL
|
35
|
+
- fix path_prefix warnings
|
36
|
+
- update to enforce best practices
|
37
|
+
- extract parts of ssh to private methods
|
38
|
+
- deprecate wrong provider names
|
39
|
+
|
40
|
+
|
1
41
|
2.1.0 03/10/2018
|
2
42
|
==========================================================
|
3
43
|
|
data/fog-core.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_dependency("builder")
|
24
24
|
spec.add_dependency("mime-types")
|
25
|
-
spec.add_dependency("excon", "~> 0.
|
25
|
+
spec.add_dependency("excon", "~> 0.71")
|
26
26
|
spec.add_dependency("formatador", "~> 0.2")
|
27
27
|
|
28
28
|
# https://github.com/fog/fog-core/issues/206
|
data/lib/fog/core/provider.rb
CHANGED
@@ -8,9 +8,22 @@ module Fog
|
|
8
8
|
end
|
9
9
|
|
10
10
|
module Provider
|
11
|
-
|
12
|
-
|
13
|
-
|
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)
|
@@ -28,13 +41,22 @@ module Fog
|
|
28
41
|
@services_registry.keys
|
29
42
|
end
|
30
43
|
|
44
|
+
# Returns service constant path, with provider, as string. If
|
45
|
+
# "provider::service" is defined (the preferred format) then it returns that
|
46
|
+
# string, otherwise it returns the deprecated string "service::provider".
|
31
47
|
def service_klass(constant_string)
|
32
48
|
eval([to_s, constant_string].join("::"))
|
33
49
|
[to_s, constant_string].join("::")
|
34
50
|
rescue NameError
|
35
51
|
provider = to_s.split("::").last
|
36
52
|
Fog::Logger.deprecation("Unable to load #{[to_s, constant_string].join("::")}")
|
37
|
-
Fog::Logger.deprecation(
|
53
|
+
Fog::Logger.deprecation(
|
54
|
+
format(
|
55
|
+
Fog::ServicesMixin::E_SERVICE_PROVIDER_CONSTANT,
|
56
|
+
service: constant_string,
|
57
|
+
provider: provider
|
58
|
+
)
|
59
|
+
)
|
38
60
|
['Fog', constant_string, provider].join("::")
|
39
61
|
end
|
40
62
|
end
|
data/lib/fog/core/scp.rb
CHANGED
@@ -64,8 +64,9 @@ module Fog
|
|
64
64
|
|
65
65
|
@address = address
|
66
66
|
@username = username
|
67
|
-
@options = { :paranoid => false, :verify_host_key =>
|
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)
|
@@ -1,21 +1,37 @@
|
|
1
1
|
module Fog
|
2
2
|
module ServicesMixin
|
3
|
+
E_SERVICE_PROVIDER_CONSTANT = <<-EOS.gsub(/\s+/, ' ').strip.freeze
|
4
|
+
Falling back to deprecated constant Fog::%<service>s::%<provider>s. The
|
5
|
+
preferred format of service provider constants has changed from
|
6
|
+
service::provider to provider::service. Please update this service
|
7
|
+
provider to use the preferred format.
|
8
|
+
EOS
|
9
|
+
E_SERVICE_PROVIDER_PATH = <<-EOS.gsub(/\s+/, ' ').strip.freeze
|
10
|
+
Falling back to deprecated path fog/%<service>s/%<provider>s. The
|
11
|
+
preferred file path format has changed from service/provider to
|
12
|
+
provider/service. Please update this service provider to use the preferred
|
13
|
+
format.
|
14
|
+
EOS
|
15
|
+
|
3
16
|
def [](provider)
|
4
17
|
new(:provider => provider)
|
5
18
|
end
|
6
19
|
|
7
20
|
def new(attributes)
|
8
|
-
attributes
|
9
|
-
provider
|
10
|
-
|
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]
|
11
25
|
|
12
|
-
raise ArgumentError, "#{
|
26
|
+
raise ArgumentError, "#{provider_alias} is not a recognized provider" unless providers.include?(provider) || providers.include?(provider_alias)
|
13
27
|
|
14
|
-
require_service_provider_library(service_name.downcase,
|
28
|
+
require_service_provider_library(service_name.downcase, provider_alias)
|
15
29
|
spc = service_provider_constant(service_name, provider_name)
|
16
30
|
spc.new(attributes)
|
17
|
-
rescue LoadError, NameError # Only rescue errors in finding the libraries, allow connection errors through to the caller
|
18
|
-
|
31
|
+
rescue LoadError, NameError => e # Only rescue errors in finding the libraries, allow connection errors through to the caller
|
32
|
+
Fog::Logger.warning("Error while loading provider #{provider_alias}: #{e.message}")
|
33
|
+
Fog::Logger.debug("backtrace: #{e.backtrace.join("\n")}")
|
34
|
+
raise Fog::Service::NotFound, "#{provider_alias} has no #{service_name.downcase} service"
|
19
35
|
end
|
20
36
|
|
21
37
|
def providers
|
@@ -32,7 +48,9 @@ module Fog
|
|
32
48
|
require "fog/#{provider}/#{service}"
|
33
49
|
rescue LoadError # Try to require the service provider in an alternate location
|
34
50
|
Fog::Logger.deprecation("Unable to require fog/#{provider}/#{service}")
|
35
|
-
Fog::Logger.deprecation(
|
51
|
+
Fog::Logger.deprecation(
|
52
|
+
format(E_SERVICE_PROVIDER_PATH, service: service, provider: provider)
|
53
|
+
)
|
36
54
|
require "fog/#{service}/#{provider}"
|
37
55
|
end
|
38
56
|
|
@@ -40,7 +58,9 @@ module Fog
|
|
40
58
|
Fog.const_get(provider_name).const_get(*const_get_args(service_name))
|
41
59
|
rescue NameError # Try to find the constant from in an alternate location
|
42
60
|
Fog::Logger.deprecation("Unable to load Fog::#{provider_name}::#{service_name}")
|
43
|
-
Fog::Logger.deprecation(
|
61
|
+
Fog::Logger.deprecation(
|
62
|
+
format(E_SERVICE_PROVIDER_CONSTANT, service: service_name, provider: provider_name)
|
63
|
+
)
|
44
64
|
Fog.const_get(service_name).const_get(*const_get_args(provider_name))
|
45
65
|
end
|
46
66
|
|
data/lib/fog/core/ssh.rb
CHANGED
@@ -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 =>
|
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
|
|
data/lib/fog/core/version.rb
CHANGED
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.
|
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:
|
12
|
+
date: 2020-09-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '0.
|
48
|
+
version: '0.71'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '0.
|
55
|
+
version: '0.71'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: formatador
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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,9 +336,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
336
|
- !ruby/object:Gem::Version
|
336
337
|
version: '0'
|
337
338
|
requirements: []
|
338
|
-
|
339
|
-
|
340
|
-
signing_key:
|
339
|
+
rubygems_version: 3.1.2
|
340
|
+
signing_key:
|
341
341
|
specification_version: 4
|
342
342
|
summary: Shared classes and tests for fog providers and services.
|
343
343
|
test_files:
|