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 +4 -4
- data/i18n/errors/en.yml +8 -0
- data/lib/chef_apply/action/base.rb +1 -1
- data/lib/chef_apply/action/converge_target.rb +2 -2
- data/lib/chef_apply/action/converge_target/ccr_failure_mapper.rb +1 -1
- data/lib/chef_apply/action/generate_local_policy.rb +2 -2
- data/lib/chef_apply/action/generate_temp_cookbook.rb +4 -4
- data/lib/chef_apply/action/generate_temp_cookbook/recipe_lookup.rb +4 -4
- data/lib/chef_apply/action/generate_temp_cookbook/temp_cookbook.rb +3 -3
- data/lib/chef_apply/action/install_chef.rb +3 -3
- data/lib/chef_apply/action/install_chef/minimum_chef_version.rb +2 -2
- data/lib/chef_apply/cli.rb +17 -17
- data/lib/chef_apply/cli/help.rb +1 -1
- data/lib/chef_apply/cli/options.rb +3 -3
- data/lib/chef_apply/cli/validation.rb +1 -1
- data/lib/chef_apply/config.rb +1 -1
- data/lib/chef_apply/file_fetcher.rb +2 -2
- data/lib/chef_apply/startup.rb +5 -5
- data/lib/chef_apply/target_host.rb +4 -4
- data/lib/chef_apply/target_resolver.rb +2 -2
- data/lib/chef_apply/telemeter.rb +5 -1
- data/lib/chef_apply/text.rb +2 -2
- data/lib/chef_apply/ui/error_printer.rb +5 -5
- data/lib/chef_apply/ui/plain_text_header.rb +1 -1
- data/lib/chef_apply/ui/terminal.rb +5 -5
- data/lib/chef_apply/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: ad9eb2a00a65b3d1d03441680ad36f7433bc961cb794749f5985e8d87e92c0a1
|
4
|
+
data.tar.gz: e1ca1f8b42516ffacb87173ca9e1c4ead3220df2229dfe6e8a7cfc43b65d949c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bcfbccbe51d54da792dd195d13d9eebef230a746d6a5977f7f8c06d145dc988974718253d5dab5f20d83a7fa28e8f1db475537bddbed7ae4ffac263955d9d5f
|
7
|
+
data.tar.gz: d0ed274005ae5f8ef1339cfaf4be81cfbac102e868c5871ca42bb2f421c58fdd804e5dfacf060129a14404ba82553d0138aacc58bf858d03f44f823ce21b0563
|
data/i18n/errors/en.yml
CHANGED
@@ -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: |
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
|
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
|
-
|
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,8 +15,8 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
|
19
|
-
|
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
|
-
|
18
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
19
|
-
|
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
|
-
|
107
|
+
require_relative "../file_fetcher"
|
108
108
|
ChefApply::FileFetcher.fetch(url_path)
|
109
109
|
end
|
110
110
|
|
data/lib/chef_apply/cli.rb
CHANGED
@@ -17,27 +17,27 @@
|
|
17
17
|
#
|
18
18
|
require "mixlib/cli"
|
19
19
|
|
20
|
-
|
20
|
+
require_relative "config"
|
21
21
|
require "chef-config/config"
|
22
22
|
require "chef-config/logger"
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
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
|
-
|
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
|
data/lib/chef_apply/cli/help.rb
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
|
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.
|
68
|
-
raise OptionValidationError.new("CHEFVAL001",
|
67
|
+
unless File.readable?(path)
|
68
|
+
raise OptionValidationError.new("CHEFVAL001", nil, path)
|
69
69
|
end
|
70
70
|
|
71
71
|
path
|
data/lib/chef_apply/config.rb
CHANGED
data/lib/chef_apply/startup.rb
CHANGED
@@ -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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
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
|
-
|
19
|
-
|
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
|
-
|
137
|
+
require_relative "target_host/linux"
|
138
138
|
class << self; include ChefApply::TargetHost::Linux; end
|
139
139
|
when :windows
|
140
|
-
|
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)
|
data/lib/chef_apply/telemeter.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/chef_apply/text.rb
CHANGED
@@ -16,8 +16,8 @@
|
|
16
16
|
#
|
17
17
|
|
18
18
|
require "r18n-desktop"
|
19
|
-
|
20
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
@@ -17,11 +17,11 @@
|
|
17
17
|
|
18
18
|
require "tty-spinner"
|
19
19
|
require "tty-cursor"
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
data/lib/chef_apply/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|