Fix issues with inspec compliance upload

Issues with underlying API changes caused a break in the current `inspec compliance upload`

This diff shows the change in API:

3cc2ee63e0...85c815011a (diff-9d107f8e84fe350fa821fed1838dbda8L162)

Implementing the same change in the `inspec-compliance` plugin fixes the
following issue:

```
Traceback (most recent call last):
        11: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/inspec-3.6.12/bin/inspec:12:in `<main>'
        10: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
         9: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         8: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         7: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         6: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor.rb:238:in `block in subcommand'
         5: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
         4: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         3: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         2: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         1: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/inspec-3.6.12/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb:144:in `upload'
/hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/inspec-3.6.12/lib/inspec/backend.rb:45:in `create': undefined method `unpack_train_credentials' for {:target=>"mock://"}:Hash (NoMethodError)
```

Signed-off-by: skylerto <skylerclayne@gmail.com>
This commit is contained in:
skylerto 2019-02-25 10:24:27 -05:00
parent 8c37a61494
commit 51cda478d2

View file

@ -141,7 +141,7 @@ module InspecPlugins
configure_logger(o)
# only run against the mock backend, otherwise we run against the local system
o[:backend] = Inspec::Backend.create(target: 'mock://')
o[:backend] = Inspec::Backend.create(Inspec::Config.mock)
o[:check_mode] = true
o[:vendor_cache] = Inspec::Cache.new(o[:vendor_cache])