chef-apply 0.4.13 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40458ce08a16fb6db8c58202ac973c791d653be6b32700a493779ba1ff540dd2
4
- data.tar.gz: 68a27c1c83e4009fb29b2fc355091f52bb23f25ea3465069e278982db67b353f
3
+ metadata.gz: ad9eb2a00a65b3d1d03441680ad36f7433bc961cb794749f5985e8d87e92c0a1
4
+ data.tar.gz: e1ca1f8b42516ffacb87173ca9e1c4ead3220df2229dfe6e8a7cfc43b65d949c
5
5
  SHA512:
6
- metadata.gz: da9d028ca6b0033430f5c8740a1f6c6317eff7331e59ad48d0e198f2fca2f905cb3ea9fa482d0c4366003028bcc5e301cc0c994adfba621ed487637a7348b50a
7
- data.tar.gz: aab2c0073c5e20a56045b750044964d336b84da4d2e36085c2efc13386a24d7631d9c8fc2e75a2018189cb694f0adb3779225b5ebab70b892dfaac508e2af632
6
+ metadata.gz: 7bcfbccbe51d54da792dd195d13d9eebef230a746d6a5977f7f8c06d145dc988974718253d5dab5f20d83a7fa28e8f1db475537bddbed7ae4ffac263955d9d5f
7
+ data.tar.gz: d0ed274005ae5f8ef1339cfaf4be81cfbac102e868c5871ca42bb2f421c58fdd804e5dfacf060129a14404ba82553d0138aacc58bf858d03f44f823ce21b0563
@@ -257,6 +257,14 @@ errors:
257
257
  %1
258
258
 
259
259
  # CLI argument validation errors
260
+ #
261
+ CHEFVAL001:
262
+ display: { decorations: false }
263
+ text: |
264
+ The key file you specified does not exist or can't be read.
265
+
266
+ You provided '%1'.
267
+
260
268
  CHEFVAL002:
261
269
  display: { decorations: false }
262
270
  text: |
@@ -16,7 +16,7 @@
16
16
  #
17
17
 
18
18
  require "chef/telemeter"
19
- require "chef_apply/error"
19
+ require_relative "../error"
20
20
 
21
21
  module ChefApply
22
22
  module Action
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/action/base"
18
+ require_relative "base"
19
19
  require "pathname"
20
20
  require "tempfile"
21
21
  # FLAG: require "chef/util/path_helper"
@@ -159,7 +159,7 @@ module ChefApply::Action
159
159
  end
160
160
 
161
161
  def handle_ccr_error
162
- require "chef_apply/action/converge_target/ccr_failure_mapper"
162
+ require_relative "converge_target/ccr_failure_mapper"
163
163
  mapper_opts = {}
164
164
  content = target_host.fetch_file_contents(chef_report_path)
165
165
  if content.nil?
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/error"
18
+ require_relative "../../error"
19
19
 
20
20
  module ChefApply
21
21
  module Action
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/action/base"
19
- require "chef_apply/error"
18
+ require_relative "base"
19
+ require_relative "../error"
20
20
  module ChefApply::Action
21
21
  class GenerateLocalPolicy < Base
22
22
  attr_reader :archive_file_location
@@ -14,8 +14,8 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- require "chef_apply/action/base"
18
- require "chef_apply/error"
17
+ require_relative "base"
18
+ require_relative "../error"
19
19
  module ChefApply
20
20
  module Action
21
21
  class GenerateTempCookbook < Base
@@ -35,7 +35,7 @@ module ChefApply
35
35
 
36
36
  def initialize(options)
37
37
  super(options)
38
- require "chef_apply/action/generate_temp_cookbook/temp_cookbook"
38
+ require_relative "generate_temp_cookbook/temp_cookbook"
39
39
  @generated_cookbook ||= TempCookbook.new
40
40
  end
41
41
 
@@ -59,7 +59,7 @@ module ChefApply
59
59
  ChefApply::Log.debug("#{recipe_specifier} is a valid path to a recipe")
60
60
  recipe_path = recipe_specifier
61
61
  else
62
- require "chef_apply/action/generate_temp_cookbook/recipe_lookup"
62
+ require_relative "generate_temp_cookbook/recipe_lookup"
63
63
  rl = RecipeLookup.new(repo_paths)
64
64
  cookbook_path_or_name, optional_recipe_name = rl.split(recipe_specifier)
65
65
  cookbook = rl.load_cookbook(cookbook_path_or_name)
@@ -16,10 +16,10 @@
16
16
  #
17
17
 
18
18
  require "chef-config/config"
19
- require "chef_apply/config"
20
- require "chef_apply/error"
21
- require "chef_apply/log"
22
- require "chef_apply/action/base"
19
+ require_relative "../../config"
20
+ require_relative "../../error"
21
+ require_relative "../../log"
22
+ require_relative "../base"
23
23
 
24
24
  module ChefApply
25
25
  module Action
@@ -17,9 +17,9 @@
17
17
 
18
18
  require "tmpdir"
19
19
  require "fileutils"
20
- require "chef_apply/log"
21
- require "chef_apply/error"
22
- require "chef_apply/action/generate_temp_cookbook"
20
+ require_relative "../../log"
21
+ require_relative "../../error"
22
+ require_relative "../generate_temp_cookbook"
23
23
  module ChefApply
24
24
  module Action
25
25
  class GenerateTempCookbook
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/action/base"
19
- require "chef_apply/action/install_chef/minimum_chef_version"
18
+ require_relative "base"
19
+ require_relative "install_chef/minimum_chef_version"
20
20
  require "fileutils"
21
21
 
22
22
  module ChefApply
@@ -104,7 +104,7 @@ module ChefApply
104
104
  end
105
105
 
106
106
  def download_to_workstation(url_path)
107
- require "chef_apply/file_fetcher"
107
+ require_relative "../file_fetcher"
108
108
  ChefApply::FileFetcher.fetch(url_path)
109
109
  end
110
110
 
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/error"
19
- require "chef_apply/action/install_chef/minimum_chef_version"
18
+ require_relative "../../error"
19
+ require_relative "minimum_chef_version"
20
20
 
21
21
  module ChefApply
22
22
  module Action
@@ -17,27 +17,27 @@
17
17
  #
18
18
  require "mixlib/cli"
19
19
 
20
- require "chef_apply/config"
20
+ require_relative "config"
21
21
  require "chef-config/config"
22
22
  require "chef-config/logger"
23
23
 
24
- require "chef_apply/cli/validation"
25
- require "chef_apply/cli/options"
26
- require "chef_apply/cli/help"
27
- require "chef_apply/error"
28
- require "chef_apply/log"
29
- require "chef_apply/target_host"
30
- require "chef_apply/target_resolver"
31
- require "chef_apply/telemeter"
32
- require "chef_apply/ui/error_printer"
33
- require "chef_apply/ui/terminal"
34
- require "chef_apply/ui/terminal/job"
24
+ require_relative "cli/validation"
25
+ require_relative "cli/options"
26
+ require_relative "cli/help"
27
+ require_relative "error"
28
+ require_relative "log"
29
+ require_relative "target_host"
30
+ require_relative "target_resolver"
31
+ require_relative "telemeter"
32
+ require_relative "ui/error_printer"
33
+ require_relative "ui/terminal"
34
+ require_relative "ui/terminal/job"
35
35
  require "license_acceptance/cli_flags/mixlib_cli"
36
36
  require "license_acceptance/acceptor"
37
37
 
38
- require "chef_apply/action/generate_temp_cookbook"
39
- require "chef_apply/action/generate_local_policy"
40
- require "chef_apply/action/converge_target"
38
+ require_relative "action/generate_temp_cookbook"
39
+ require_relative "action/generate_local_policy"
40
+ require_relative "action/converge_target"
41
41
 
42
42
  module ChefApply
43
43
  class CLI
@@ -179,7 +179,7 @@ module ChefApply
179
179
  end
180
180
 
181
181
  def install(target_host, reporter)
182
- require "chef_apply/action/install_chef"
182
+ require_relative "action/install_chef"
183
183
  context = TS.install_chef
184
184
  reporter.update(context.verifying)
185
185
  installer = Action::InstallChef.new(target_host: target_host, check_only: !parsed_options[:install])
@@ -282,7 +282,7 @@ module ChefApply
282
282
  end
283
283
 
284
284
  def handle_perform_error(e)
285
- require "chef_apply/errors/standard_error_resolver"
285
+ require_relative "errors/standard_error_resolver"
286
286
  id = e.respond_to?(:id) ? e.id : e.class.to_s
287
287
  # TODO: This is currently sending host information for certain ssh errors
288
288
  # post release we need to scrub this data. For now I'm redacting the
@@ -61,7 +61,7 @@ module ChefApply
61
61
  end
62
62
 
63
63
  def show_version
64
- require "chef_apply/version"
64
+ require_relative "../version"
65
65
  UI::Terminal.output T.version.show(ChefApply::VERSION)
66
66
  end
67
67
  end
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/text"
18
+ require_relative "../text"
19
19
 
20
20
  # Moving the options into here so the cli.rb file is smaller and easier to read
21
21
  # For options that need to be merged back into the global ChefApply::Config object
@@ -64,8 +64,8 @@ module ChefApply
64
64
  description: T.identity_file,
65
65
  proc: (Proc.new do |paths|
66
66
  path = paths
67
- unless File.exist?(path)
68
- raise OptionValidationError.new("CHEFVAL001", self, path)
67
+ unless File.readable?(path)
68
+ raise OptionValidationError.new("CHEFVAL001", nil, path)
69
69
  end
70
70
 
71
71
  path
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/error"
18
+ require_relative "../error"
19
19
 
20
20
  module ChefApply
21
21
  class CLI
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/log"
18
+ require_relative "log"
19
19
  require "mixlib/config"
20
20
  require "fileutils"
21
21
  require "pathname"
@@ -17,8 +17,8 @@
17
17
 
18
18
  require "net/http"
19
19
  require "uri"
20
- require "chef_apply/config"
21
- require "chef_apply/log"
20
+ require_relative "config"
21
+ require_relative "log"
22
22
 
23
23
  module ChefApply
24
24
  class FileFetcher
@@ -14,10 +14,10 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- require "chef_apply/config"
18
- require "chef_apply/text"
19
- require "chef_apply/ui/terminal"
20
- require "chef_apply/telemeter"
17
+ require_relative "config"
18
+ require_relative "text"
19
+ require_relative "ui/terminal"
20
+ require_relative "telemeter"
21
21
  require "chef/log"
22
22
  require "chef/config"
23
23
  module ChefApply
@@ -195,7 +195,7 @@ module ChefApply
195
195
  end
196
196
 
197
197
  def start_chef_apply
198
- require "chef_apply/cli"
198
+ require_relative "cli"
199
199
  ChefApply::CLI.new(@argv).run
200
200
  end
201
201
 
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/log"
19
- require "chef_apply/error"
18
+ require_relative "log"
19
+ require_relative "error"
20
20
  require "train"
21
21
 
22
22
  module ChefApply
@@ -134,10 +134,10 @@ module ChefApply
134
134
  def mix_in_target_platform!
135
135
  case base_os
136
136
  when :linux
137
- require "chef_apply/target_host/linux"
137
+ require_relative "target_host/linux"
138
138
  class << self; include ChefApply::TargetHost::Linux; end
139
139
  when :windows
140
- require "chef_apply/target_host/windows"
140
+ require_relative "target_host/windows"
141
141
  class << self; include ChefApply::TargetHost::Windows; end
142
142
  when :other
143
143
  raise ChefApply::TargetHost::UnsupportedTargetOS.new(platform.name)
@@ -15,8 +15,8 @@
15
15
  # limitations under the License.
16
16
  #
17
17
 
18
- require "chef_apply/target_host"
19
- require "chef_apply/error"
18
+ require_relative "target_host"
19
+ require_relative "error"
20
20
 
21
21
  module ChefApply
22
22
  class TargetResolver
@@ -18,7 +18,7 @@
18
18
  require "chef/telemeter"
19
19
  # Monkey patch the telemetry lib to respect our config.toml
20
20
  # entry for telemetry.
21
- require "chef_apply/telemeter/patch"
21
+ require_relative "telemeter/patch"
22
22
  module ChefApply
23
23
  class Telemeter
24
24
  def self.timed_action_capture(action, &block)
@@ -36,5 +36,9 @@ module ChefApply
36
36
  end
37
37
  Chef::Telemeter.timed_capture(:action, { action: action.name, target: target_data }, &block)
38
38
  end
39
+
40
+ def self.capture(name, data = {}, options = {})
41
+ Chef::Telemeter.capture(name, data, options)
42
+ end
39
43
  end
40
44
  end
@@ -16,8 +16,8 @@
16
16
  #
17
17
 
18
18
  require "r18n-desktop"
19
- require "chef_apply/text/text_wrapper"
20
- require "chef_apply/text/error_translation"
19
+ require_relative "text/text_wrapper"
20
+ require_relative "text/error_translation"
21
21
 
22
22
  # A very thin wrapper around R18n, the idea being that we're likely to replace r18n
23
23
  # down the road and don't want to have to change all of our commands.
@@ -17,11 +17,11 @@
17
17
 
18
18
  require "train/errors"
19
19
  require "pastel"
20
- require "chef_apply/error"
21
- require "chef_apply/config"
22
- require "chef_apply/text"
23
- require "chef_apply/ui/terminal"
24
- require "chef_apply/errors/standard_error_resolver"
20
+ require_relative "../error"
21
+ require_relative "../config"
22
+ require_relative "../text"
23
+ require_relative "terminal"
24
+ require_relative "../errors/standard_error_resolver"
25
25
 
26
26
  module ChefApply::UI
27
27
  class ErrorPrinter
@@ -15,7 +15,7 @@
15
15
  # limitations under the License.
16
16
  #
17
17
  require "thread"
18
- require "chef_apply/ui/plain_text_element"
18
+ require_relative "plain_text_element"
19
19
 
20
20
  module ChefApply
21
21
  module UI
@@ -17,11 +17,11 @@
17
17
 
18
18
  require "tty-spinner"
19
19
  require "tty-cursor"
20
- require "chef_apply/status_reporter"
21
- require "chef_apply/config"
22
- require "chef_apply/log"
23
- require "chef_apply/ui/plain_text_element"
24
- require "chef_apply/ui/plain_text_header"
20
+ require_relative "../status_reporter"
21
+ require_relative "../config"
22
+ require_relative "../log"
23
+ require_relative "plain_text_element"
24
+ require_relative "plain_text_header"
25
25
 
26
26
  module ChefApply
27
27
  module UI
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefApply
19
- VERSION = "0.4.13".freeze
19
+ VERSION = "0.4.15".freeze
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-apply
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.13
4
+ version: 0.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-24 00:00:00.000000000 Z
11
+ date: 2020-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-cli