chef-apply 0.6.7 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/chef-apply.gemspec +1 -1
- data/lib/chef_apply/action/base.rb +9 -9
- data/lib/chef_apply/cli.rb +5 -5
- data/lib/chef_apply/file_fetcher.rb +17 -17
- data/lib/chef_apply/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f30291abd4af8458afefb7462bce10d03a063fe81b97eebd51d531cb3f143b9
|
4
|
+
data.tar.gz: 999fe608ed0c409c242079e43de8f19a9498b5310a262b632de2594175803c63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35be39538674afbaa34893e1231e34c5ddedc6b5ca13c251a2cb3e75790ed41a332d3ca04f130bc9c18cdf563f45d12aa003f290bb88f1cd555d228cabd3e987
|
7
|
+
data.tar.gz: 5438e35ec7367378afcc841bcca6e3e57f35b98cc0153ab67d9d8515321d4c65a69c5214fcbacaa8a8d89dfe13d2fcce4fb40f3acdfb6ddcfa6ff8f1de01cc9f
|
data/Gemfile
CHANGED
data/chef-apply.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.description = "Ad-hoc management of individual nodes and devices."
|
30
30
|
spec.homepage = "https://github.com/chef/chef-apply"
|
31
31
|
spec.license = "Apache-2.0"
|
32
|
-
spec.required_ruby_version = ">= 2.
|
32
|
+
spec.required_ruby_version = ">= 2.7"
|
33
33
|
|
34
34
|
spec.files = %w{Rakefile LICENSE warning.txt} +
|
35
35
|
Dir.glob("Gemfile*") + # Includes Gemfile and locks
|
@@ -41,15 +41,15 @@ module ChefApply
|
|
41
41
|
def run(&block)
|
42
42
|
@notification_handler = block
|
43
43
|
Telemeter.timed_action_capture(self) do
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
44
|
+
|
45
|
+
perform_action
|
46
|
+
rescue StandardError => e
|
47
|
+
# Give the caller a chance to clean up - if an exception is
|
48
|
+
# raised it'll otherwise get routed through the executing thread,
|
49
|
+
# providing no means of feedback for the caller's current task.
|
50
|
+
notify(:error, e)
|
51
|
+
@error = e
|
52
|
+
|
53
53
|
end
|
54
54
|
# Raise outside the block to ensure that the telemetry cpature completes
|
55
55
|
raise @error unless @error.nil?
|
data/lib/chef_apply/cli.rb
CHANGED
@@ -69,11 +69,11 @@ module ChefApply
|
|
69
69
|
# they will be captured in the same telemetry session.
|
70
70
|
|
71
71
|
Chef::Telemeter.timed_run_capture([:redacted]) do
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
|
73
|
+
perform_run(enforce_license: enforce_license)
|
74
|
+
rescue Exception => e
|
75
|
+
@rc = handle_run_error(e)
|
76
|
+
|
77
77
|
end
|
78
78
|
rescue => e # can occur if exception thrown in error handling
|
79
79
|
@rc = handle_run_error(e)
|
@@ -44,25 +44,25 @@ module ChefApply
|
|
44
44
|
file = open(temp_path, "wb")
|
45
45
|
ChefApply::Log.debug "Downloading: #{temp_path}"
|
46
46
|
Net::HTTP.start(url.host) do |http|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
52
|
-
end
|
53
|
-
rescue e
|
54
|
-
@error = true
|
55
|
-
raise
|
56
|
-
ensure
|
57
|
-
file.close
|
58
|
-
# If any failures occurred, don't risk keeping
|
59
|
-
# an incomplete download that we'll see as 'cached'
|
60
|
-
if @error
|
61
|
-
FileUtils.rm_f(temp_path)
|
62
|
-
else
|
63
|
-
FileUtils.mv(temp_path, local_path)
|
47
|
+
|
48
|
+
http.request_get(url.path) do |resp|
|
49
|
+
resp.read_body do |segment|
|
50
|
+
file.write(segment)
|
64
51
|
end
|
65
52
|
end
|
53
|
+
rescue e
|
54
|
+
@error = true
|
55
|
+
raise
|
56
|
+
ensure
|
57
|
+
file.close
|
58
|
+
# If any failures occurred, don't risk keeping
|
59
|
+
# an incomplete download that we'll see as 'cached'
|
60
|
+
if @error
|
61
|
+
FileUtils.rm_f(temp_path)
|
62
|
+
else
|
63
|
+
FileUtils.mv(temp_path, local_path)
|
64
|
+
end
|
65
|
+
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
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
|
+
version: 0.7.1
|
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: 2021-
|
11
|
+
date: 2021-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|
@@ -281,7 +281,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
281
281
|
requirements:
|
282
282
|
- - ">="
|
283
283
|
- !ruby/object:Gem::Version
|
284
|
-
version: '2.
|
284
|
+
version: '2.7'
|
285
285
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
286
286
|
requirements:
|
287
287
|
- - ">="
|