train 1.4.11 → 1.4.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6286b3582330ddddd3d2eefb05547a5a8762bb8cc213f42c61a7ce50a053df98
4
- data.tar.gz: b9bcba134f4365243958c5f2456512f72c59fc769d43516ac22ef298bb9789e2
3
+ metadata.gz: 8e221bdf06659f4754f5628e2c9ceb548472c0474eee1c8ef9016e33cf12a935
4
+ data.tar.gz: 1f9306bec3656802db640c9249c4895fc3fb7bde05a503597a8f980f724341b0
5
5
  SHA512:
6
- metadata.gz: ecfa278786d83430a228b1a8a67cb187957147e87617f93583c85867177ccdd23a14417f32fb659cbc8470752d50e8a11a65b32b5226c7fc0ef8d0812e509e24
7
- data.tar.gz: a3a08fd6a68c9722f6daa5bc7840a2ebe7dee6e01d3826170c597426a9460a4258b4d1d179bcd32a93a575578c113c20be631c43d07b378f3a05eaaa2167718b
6
+ metadata.gz: 33230dfafa35626de7dc94770e5000327134aad336f8dc99fa04381ecde4390a1b67eca92149882943c9fb2346a70efe9ce884d50322d08ed0b505aaf7b420b0
7
+ data.tar.gz: 668dca30063621341c33202c39bbdeed1fe26aed5c9d9bd568a1e34f83d7a340b93332a4e6e9e766ea96a7264f2ff3c7997182d82eab4f4a3c5e23a8b93acc57
@@ -1,23 +1,31 @@
1
- <!-- latest_release 1.4.11 -->
2
- ## [v1.4.11](https://github.com/chef/train/tree/v1.4.11) (2018-05-17)
1
+ <!-- latest_release 1.4.15 -->
2
+ ## [v1.4.15](https://github.com/inspec/train/tree/v1.4.15) (2018-06-14)
3
3
 
4
4
  #### Merged Pull Requests
5
- - Add required env for azure shell msi headers [#302](https://github.com/chef/train/pull/302) ([jquick](https://github.com/jquick))
5
+ - Don&#39;t double-escape paths [#306](https://github.com/inspec/train/pull/306) ([voroniys](https://github.com/voroniys))
6
6
  <!-- latest_release -->
7
7
 
8
- <!-- release_rollup since=1.4.10 -->
9
- ### Changes since 1.4.10 release
8
+ <!-- release_rollup since=1.4.11 -->
9
+ ### Changes since 1.4.11 release
10
10
 
11
11
  #### Merged Pull Requests
12
- - Add required env for azure shell msi headers [#302](https://github.com/chef/train/pull/302) ([jquick](https://github.com/jquick)) <!-- 1.4.11 -->
12
+ - Don&#39;t double-escape paths [#306](https://github.com/inspec/train/pull/306) ([voroniys](https://github.com/voroniys)) <!-- 1.4.15 -->
13
+ - Add the mock transport to train-core [#308](https://github.com/inspec/train/pull/308) ([jquick](https://github.com/jquick)) <!-- 1.4.14 -->
14
+ - Adding Oneview to platform detection. [#307](https://github.com/inspec/train/pull/307) ([skpaterson](https://github.com/skpaterson)) <!-- 1.4.13 -->
15
+ - Allow TrainError to provide a supplement reason [#303](https://github.com/chef/train/pull/303) ([marcparadise](https://github.com/marcparadise)) <!-- 1.4.12 -->
13
16
  <!-- release_rollup -->
14
17
 
15
18
  <!-- latest_stable_release -->
19
+ ## [v1.4.11](https://github.com/chef/train/tree/v1.4.11) (2018-05-17)
20
+
21
+ #### Merged Pull Requests
22
+ - Add required env for azure shell msi headers [#302](https://github.com/chef/train/pull/302) ([jquick](https://github.com/jquick))
23
+ <!-- latest_stable_release -->
24
+
16
25
  ## [v1.4.10](https://github.com/chef/train/tree/v1.4.10) (2018-05-17)
17
26
 
18
27
  #### Merged Pull Requests
19
28
  - support sudo passwords for cisco [#301](https://github.com/chef/train/pull/301) ([arlimus](https://github.com/arlimus))
20
- <!-- latest_stable_release -->
21
29
 
22
30
  ## [v1.4.9](https://github.com/chef/train/tree/v1.4.9) (2018-05-16)
23
31
 
@@ -10,7 +10,14 @@
10
10
 
11
11
  module Train
12
12
  # Base exception for any exception explicitly raised by the Train library.
13
- class Error < ::StandardError; end
13
+ class Error < ::StandardError
14
+ attr_reader :reason
15
+
16
+ def initialize(message = '', reason = :not_provided)
17
+ super(message)
18
+ @reason = reason
19
+ end
20
+ end
14
21
 
15
22
  # Base exception class for all exceptions that are caused by user input
16
23
  # errors.
@@ -58,15 +58,15 @@ module Train::Extras
58
58
  rawerr = res.stdout + ' ' + res.stderr
59
59
 
60
60
  {
61
- 'Sorry, try again' => 'Wrong sudo password.',
61
+ 'Sorry, try again' => ['Wrong sudo password.', :bad_sudo_password],
62
62
  'sudo: no tty present and no askpass program specified' =>
63
- 'Sudo requires a password, please configure it.',
63
+ ['Sudo requires a password, please configure it.', :sudo_password_required],
64
64
  'sudo: command not found' =>
65
- "Can't find sudo command. Please either install and "\
66
- 'configure it on the target or deactivate sudo.',
65
+ ["Can't find sudo command. Please either install and "\
66
+ 'configure it on the target or deactivate sudo.', :sudo_command_not_found],
67
67
  'sudo: sorry, you must have a tty to run sudo' =>
68
- 'Sudo requires a TTY. Please see the README on how to configure '\
69
- 'sudo to allow for non-interactive usage.',
68
+ ['Sudo requires a TTY. Please see the README on how to configure '\
69
+ 'sudo to allow for non-interactive usage.', :sudo_no_tty],
70
70
  }.each do |sudo, human|
71
71
  rawerr = human if rawerr.include? sudo
72
72
  end
@@ -128,8 +128,11 @@ module Train::Extras
128
128
  if transport.os.unix?
129
129
  return nil unless LinuxCommand.active?(options)
130
130
  res = LinuxCommand.new(transport, options)
131
- msg = res.verify
132
- fail Train::UserError, "Sudo failed: #{msg}" unless msg.nil?
131
+ verification_res = res.verify
132
+ if verification_res
133
+ msg, reason = verification_res
134
+ raise Train::UserError.new("Sudo failed: #{msg}", reason)
135
+ end
133
136
  res
134
137
  end
135
138
  end
@@ -47,7 +47,7 @@ module Train
47
47
 
48
48
  def mounted
49
49
  @mounted ||=
50
- @backend.run_command("mount | grep -- ' on #{@spath} '")
50
+ @backend.run_command("mount | grep -- ' on #{@path} '")
51
51
  end
52
52
 
53
53
  def grouped_into?(sth)
@@ -33,7 +33,7 @@ module Train
33
33
 
34
34
  def mounted
35
35
  @mounted ||=
36
- @backend.run_command("mount | grep -- ' on #{@spath} '")
36
+ @backend.run_command("mount | grep -- ' on #{@path} '")
37
37
  end
38
38
 
39
39
  %w{
@@ -11,6 +11,8 @@ module Train::Platforms::Detect::Specifications
11
11
  plat.name('aws').in_family('cloud')
12
12
  plat.name('azure').in_family('cloud')
13
13
  plat.name('gcp').in_family('cloud')
14
+ plat.family('iaas').in_family('api')
15
+ plat.name('oneview').in_family('iaas')
14
16
  end
15
17
  end
16
18
  end
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '1.4.11'.freeze
6
+ VERSION = '1.4.15'.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.4.11
4
+ version: 1.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-17 00:00:00.000000000 Z
11
+ date: 2018-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json