train 1.7.6 → 2.0.0

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
- SHA256:
3
- metadata.gz: 75f8df972670d6fb193c583d7abdd8e6b7229d9ea0dabbdce8332609192caa38
4
- data.tar.gz: 8cc38f8584b89936cb54780f9c1fae22a372cd454691cf0dd9a21e8ccf84e656
2
+ SHA1:
3
+ metadata.gz: 02a65aa5fec96792e71ec13ac0f0c3f1b56b5e1c
4
+ data.tar.gz: 0d28ceda8cd6c60d47c2ae7ada4580843dc8dd45
5
5
  SHA512:
6
- metadata.gz: b0692f0c5e2e079c6dc8d3f19b5b4975717055ff40924c939db13f53c381e1c539dd42c72588d314953c783d13bd647835ae21f94b56c3d664af44b37fcaecde
7
- data.tar.gz: cfc401357f096653bb0bd9b4fe591067054fc045ae13c50d21ea77b2acf545fff910794b14fcca7b59d04d5679f216781d6ce73fad9ff92343954820265e601b
6
+ metadata.gz: 856dfe69fd97c8ae6eac81d1f402c781d870d8e890148e639ce9ce24cf0a1a814e0d3c2054bff181d60ee2fcfea28d4dc21eea4db15bf1b38cc59e8a0a5cfcb7
7
+ data.tar.gz: b237f902d40e58c07a8c5fc5b0059addbbb418852ce013ed65575f519e2d112a6e995d6635dc9785876ab739f540d661418c19e568a7f6058cd0f96458ef59e1
@@ -14,7 +14,8 @@ module Train::Platforms::Detect::Helpers
14
14
  end
15
15
 
16
16
  def winrm?
17
- @backend.class.to_s == 'Train::Transports::WinRM::Connection'
17
+ Object.const_defined?('Train::Transports::WinRM::Connection') &&
18
+ @backend.class == Train::Transports::WinRM::Connection
18
19
  end
19
20
 
20
21
  def unix_file_contents(path)
@@ -37,7 +37,6 @@ module Train::Platforms::Detect::Helpers
37
37
 
38
38
  raw.lines.each_with_object({}) do |line, memo|
39
39
  line.strip!
40
- next if line.start_with?('#')
41
40
  next if line.empty?
42
41
  key, value = line.split('=', 2)
43
42
  memo[key] = value.gsub(/\A"|"\Z/, '') unless value.empty?
data/lib/train/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '1.7.6'.freeze
6
+ VERSION = '2.0.0'.freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.6
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2019-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -120,20 +120,6 @@ dependencies:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
122
  version: '1.26'
123
- - !ruby/object:Gem::Dependency
124
- name: aws-sdk
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '2'
130
- type: :runtime
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - "~>"
135
- - !ruby/object:Gem::Version
136
- version: '2'
137
123
  - !ruby/object:Gem::Dependency
138
124
  name: azure_mgmt_resources
139
125
  requirement: !ruby/object:Gem::Requirement
@@ -273,7 +259,6 @@ files:
273
259
  - lib/train/plugins.rb
274
260
  - lib/train/plugins/base_connection.rb
275
261
  - lib/train/plugins/transport.rb
276
- - lib/train/transports/aws.rb
277
262
  - lib/train/transports/azure.rb
278
263
  - lib/train/transports/cisco_ios_connection.rb
279
264
  - lib/train/transports/clients/azure/graph_rbac.rb
@@ -311,7 +296,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
296
  - !ruby/object:Gem::Version
312
297
  version: '0'
313
298
  requirements: []
314
- rubygems_version: 3.0.1
299
+ rubyforge_project:
300
+ rubygems_version: 2.6.14.3
315
301
  signing_key:
316
302
  specification_version: 4
317
303
  summary: Transport interface to talk to different backends.
@@ -1,70 +0,0 @@
1
- # encoding: utf-8
2
- require 'train/plugins'
3
- require 'aws-sdk'
4
-
5
- module Train::Transports
6
- class Aws < Train.plugin(1)
7
- name 'aws'
8
- option :region, required: true, default: ENV['AWS_REGION']
9
- option :access_key_id, default: ENV['AWS_ACCESS_KEY_ID']
10
- option :secret_access_key, default: ENV['AWS_SECRET_ACCESS_KEY']
11
- option :session_token, default: ENV['AWS_SESSION_TOKEN']
12
-
13
- # This can provide the access key id and secret access key
14
- option :profile, default: ENV['AWS_PROFILE']
15
-
16
- def connection(_ = nil)
17
- @connection ||= Connection.new(@options)
18
- end
19
-
20
- class Connection < BaseConnection
21
- def initialize(options)
22
- # Override for any cli options
23
- # aws://region/my-profile
24
- options[:region] = options[:host] || options[:region]
25
- if options[:path]
26
- # string the leading / from path
27
- options[:profile] = options[:path][1..-1]
28
- end
29
- super(options)
30
-
31
- @cache_enabled[:api_call] = true
32
- @cache[:api_call] = {}
33
-
34
- # additional platform details
35
- release = Gem.loaded_specs['aws-sdk'].version
36
- @platform_details = { release: "aws-sdk-v#{release}" }
37
-
38
- connect
39
- end
40
-
41
- def platform
42
- force_platform!('aws', @platform_details)
43
- end
44
-
45
- def aws_client(klass)
46
- return klass.new unless cache_enabled?(:api_call)
47
- @cache[:api_call][klass.to_s.to_sym] ||= klass.new
48
- end
49
-
50
- def aws_resource(klass, args)
51
- klass.new(args)
52
- end
53
-
54
- def connect
55
- ENV['AWS_PROFILE'] = @options[:profile] if @options[:profile]
56
- ENV['AWS_REGION'] = @options[:region] if @options[:region]
57
- end
58
-
59
- def uri
60
- "aws://#{@options[:region]}"
61
- end
62
-
63
- def unique_identifier
64
- # use aws account id
65
- client = aws_client(::Aws::STS::Client)
66
- client.get_caller_identity.account
67
- end
68
- end
69
- end
70
- end