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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc3b546ebf62d419f93571e38929862bbe15cc8d8bc7798ae9c2d241cba866f7
4
- data.tar.gz: ea642c60686a1f36e3383b73dd58205d569749ee01f2457cd9d737236818bc78
3
+ metadata.gz: 5f30291abd4af8458afefb7462bce10d03a063fe81b97eebd51d531cb3f143b9
4
+ data.tar.gz: 999fe608ed0c409c242079e43de8f19a9498b5310a262b632de2594175803c63
5
5
  SHA512:
6
- metadata.gz: 9a7e44af40ce24424eeee41da3e7694a1ad5d32a52ba0ebfa42db2ec2c716d2387bfd281ed3faef70e37560df97712e61120f5e3bd02dd67d500996dca7d0e2b
7
- data.tar.gz: 52c394d2c66bce073082acde1a7d56f68c6d587725859bab6a58996ea968f0cfd5b9b9d9c095a4f6851318094f9ba894435678acae1436018da568a8ce4eb071
6
+ metadata.gz: 35be39538674afbaa34893e1231e34c5ddedc6b5ca13c251a2cb3e75790ed41a332d3ca04f130bc9c18cdf563f45d12aa003f290bb88f1cd555d228cabd3e987
7
+ data.tar.gz: 5438e35ec7367378afcc841bcca6e3e57f35b98cc0153ab67d9d8515321d4c65a69c5214fcbacaa8a8d89dfe13d2fcce4fb40f3acdfb6ddcfa6ff8f1de01cc9f
data/Gemfile CHANGED
@@ -19,7 +19,7 @@ source "https://rubygems.org"
19
19
  gemspec
20
20
 
21
21
  group :development do
22
- gem "chefstyle", "1.7.5"
22
+ gem "chefstyle", "2.0.7"
23
23
  gem "rake", ">= 10.1.0"
24
24
  gem "rspec", "~> 3.0"
25
25
  gem "simplecov"
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.6"
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
- begin
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
- end
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?
@@ -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
- begin
73
- perform_run(enforce_license: enforce_license)
74
- rescue Exception => e
75
- @rc = handle_run_error(e)
76
- end
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
- begin
48
- http.request_get(url.path) do |resp|
49
- resp.read_body do |segment|
50
- file.write(segment)
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
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefApply
19
- VERSION = "0.6.7".freeze
19
+ VERSION = "0.7.1".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.6.7
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-04-21 00:00:00.000000000 Z
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.6'
284
+ version: '2.7'
285
285
  required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  requirements:
287
287
  - - ">="