train 1.4.11 → 1.4.15
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/CHANGELOG.md +15 -7
 - data/lib/train/errors.rb +8 -1
 - data/lib/train/extras/command_wrapper.rb +11 -8
 - data/lib/train/file/local/unix.rb +1 -1
 - data/lib/train/file/remote/unix.rb +1 -1
 - data/lib/train/platforms/detect/specifications/api.rb +2 -0
 - data/lib/train/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8e221bdf06659f4754f5628e2c9ceb548472c0474eee1c8ef9016e33cf12a935
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1f9306bec3656802db640c9249c4895fc3fb7bde05a503597a8f980f724341b0
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 33230dfafa35626de7dc94770e5000327134aad336f8dc99fa04381ecde4390a1b67eca92149882943c9fb2346a70efe9ce884d50322d08ed0b505aaf7b420b0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 668dca30063621341c33202c39bbdeed1fe26aed5c9d9bd568a1e34f83d7a340b93332a4e6e9e766ea96a7264f2ff3c7997182d82eab4f4a3c5e23a8b93acc57
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,23 +1,31 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <!-- latest_release 1.4. 
     | 
| 
       2 
     | 
    
         
            -
            ## [v1.4. 
     | 
| 
      
 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 
     | 
    
         
            -
            -  
     | 
| 
      
 5 
     | 
    
         
            +
            - Don'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. 
     | 
| 
       9 
     | 
    
         
            -
            ### Changes since 1.4. 
     | 
| 
      
 8 
     | 
    
         
            +
            <!-- release_rollup since=1.4.11 -->
         
     | 
| 
      
 9 
     | 
    
         
            +
            ### Changes since 1.4.11 release
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
            #### Merged Pull Requests
         
     | 
| 
       12 
     | 
    
         
            -
            -  
     | 
| 
      
 12 
     | 
    
         
            +
            - Don'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 
     | 
    
         | 
    
        data/lib/train/errors.rb
    CHANGED
    
    | 
         @@ -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 
     | 
| 
      
 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 
     | 
    
         
            -
                     
     | 
| 
       132 
     | 
    
         
            -
                     
     | 
| 
      
 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
         
     | 
| 
         @@ -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
         
     | 
    
        data/lib/train/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-06-14 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: json
         
     |