chef-utils 15.9.17 → 15.13.8

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: 9b5f26cfc5632af99806129c59a02783c042b563026b67f3e96f7ca687649326
4
- data.tar.gz: 5ae59b9ee97304fdce0c2b22a8ac92e89cddf70fbac5862e4d4389765bde854b
3
+ metadata.gz: 2af50b489c73dd9137661062e12d22aee7a5202c1f64f70eb31bfa5497d96443
4
+ data.tar.gz: 537e89e51a22d3ab7d89fba3c94543474fc985e385bda9d2a918043019066e59
5
5
  SHA512:
6
- metadata.gz: a1d4be454d64efac5bec779357929b5f1fc5399da1ebdb0061a6c398374c63827d727458108b1fbfe384d6fdcf02f30f54c119dd9a1b3a73b8e00ec81e9e63a8
7
- data.tar.gz: 70f1b73ff645783185f267f085a03e214ed1fc1df5be0a4af5064881c89347a212bcd61b67095ed7f8022e9a6fad23ff7ed0a0296d67c144369730af63119268
6
+ metadata.gz: 8517e78b7cfc3f8946b16d5475e49db38619ff7890779c9237bd028054f869b3749e958a5fc1f5a12827ea31b8e05a907277fe334b6b1df89424526d0f456154
7
+ data.tar.gz: fd15f41aee73b7153191faa9c95ae8f0999f8830aa8cdd527bc51410201294c8417bff98d3cbc10200a89df701f62cf179c7457e15fd3e1c662cf0fe05e3aa24
@@ -1,5 +1,4 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require "chef-utils/version"
5
4
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2015-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -103,14 +103,24 @@ module ChefUtils
103
103
  %w{powerpc}.include?(node["kernel"]["machine"])
104
104
  end
105
105
 
106
- # Determine if the current architecture is 32-bit ARM.
106
+ # Determine if the current architecture is arm
107
+ #
108
+ # @since 15.10
109
+ #
110
+ # @return [Boolean]
111
+ #
112
+ def arm?(node = __getnode)
113
+ %w{armv6l armv7l armhf aarch64 arm64 arch64}.include?(node["kernel"]["machine"])
114
+ end
115
+
116
+ # Determine if the current architecture is 32-bit ARM hard float.
107
117
  #
108
118
  # @since 15.5
109
119
  #
110
120
  # @return [Boolean]
111
121
  #
112
122
  def armhf?(node = __getnode)
113
- %w{armhf}.include?(node["kernel"]["machine"])
123
+ %w{armv6l armv7l armhf}.include?(node["kernel"]["machine"])
114
124
  end
115
125
 
116
126
  # Determine if the current architecture is s390x.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,7 +31,7 @@ module ChefUtils
31
31
  # Determine if the node is a docker container.
32
32
  #
33
33
  # @param [Chef::Node] node the node to check
34
- # @since 15.5
34
+ # @since 12.11
35
35
  #
36
36
  # @return [Boolean]
37
37
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -301,7 +301,7 @@ module ChefUtils
301
301
  end
302
302
 
303
303
  # RedHat distros -- fedora and rhel platform_families, nothing else. This is most likely not as useful as the
304
- # "fedora_dervied?" helper.
304
+ # "fedora_derived?" helper.
305
305
  #
306
306
  # @param [Chef::Node] node the node to check
307
307
  # @since 15.5
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -161,7 +161,7 @@ module ChefUtils
161
161
  node.dig("virtualization", "system") == "openvz" && node.dig("virtualization", "role") == "host"
162
162
  end
163
163
 
164
- # Determine if the current node is running under any virutalization environment
164
+ # Determine if the current node is running under any virtualization environment
165
165
  #
166
166
  # @param [Chef::Node] node
167
167
  # @since 15.8
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,7 @@ module ChefUtils
25
25
  # Lookup an executable through the systems search PATH. Allows specifying an array
26
26
  # of executables to look for. The first executable that is found, along any path entry,
27
27
  # will be the preferred one and returned first. The extra_path will override any default
28
- # extra_paths which are added (allwing the user to pass an empty array to remove them).
28
+ # extra_paths which are added (allowing the user to pass an empty array to remove them).
29
29
  #
30
30
  # When passed a block the block will be called with the full pathname of any executables
31
31
  # which are found, and the block should return truthy or falsey values to further filter
@@ -34,7 +34,7 @@ module ChefUtils
34
34
  # This is syntactic sugar for `where(...).first`
35
35
  #
36
36
  # This helper can be used in target mode in chef or with train using the appropriate
37
- # wiring extenerally.
37
+ # wiring externally.
38
38
  #
39
39
  # @example Find the most appropriate python executable, searching through the system PATH
40
40
  # plus additionally the "/usr/libexec" directory, which has the dnf libraries
@@ -55,14 +55,14 @@ module ChefUtils
55
55
  # Lookup all the instances of an an executable that can be found through the systems search PATH.
56
56
  # Allows specifying an array of executables to look for. All the instances of the first executable
57
57
  # that is found will be returned first. The extra_path will override any default extra_paths
58
- # which are added (allwing the user to pass an empty array to remove them).
58
+ # which are added (allowing the user to pass an empty array to remove them).
59
59
  #
60
60
  # When passed a block the block will be called with the full pathname of any executables
61
61
  # which are found, and the block should return truthy or falsey values to further filter
62
62
  # the executable based on arbitrary criteria.
63
63
  #
64
64
  # This helper can be used in target mode in chef or with train using the appropriate
65
- # wiring extenerally.
65
+ # wiring externally.
66
66
  #
67
67
  # @example Find all the python executables, searching through the system PATH plus additionally
68
68
  # the "/usr/libexec" directory, which have the dnf libraries installed and available.
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,7 +27,7 @@ module ChefUtils
27
27
  #
28
28
  # This gem may be used by gems like mixlib-shellout which can be consumed by external non-Chef utilities,
29
29
  # so including brittle code here which depends on the existence of the chef-client will cause broken
30
- # behavior downstream. You must practice defensive coding, and not make assumptions about runnign within chef-client.
30
+ # behavior downstream. You must practice defensive coding, and not make assumptions about running within chef-client.
31
31
  #
32
32
  # Other consumers may mix in the helper classes and then override the methods here and provide their own custom
33
33
  # wiring and override what is provided here. They are marked as private because no downstream user should ever touch
@@ -1,4 +1,4 @@
1
- # Copyright:: Copyright 2010-2019, Chef Software Inc.
1
+ # Copyright:: Copyright (c) Chef Software Inc.
2
2
  # License:: Apache License, Version 2.0
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +14,6 @@
14
14
  # limitations under the License.
15
15
 
16
16
  module ChefUtils
17
- CHEFUTILS_ROOT = File.expand_path("../..", __FILE__)
18
- VERSION = "15.9.17".freeze
17
+ CHEFUTILS_ROOT = File.expand_path("..", __dir__)
18
+ VERSION = "15.13.8".freeze
19
19
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,17 +84,17 @@ RSpec.describe ChefUtils::DSL::Architecture do
84
84
  context "on aarch64" do
85
85
  let(:arch) { "aarch64" }
86
86
 
87
- arch_reports_true_for(:_64_bit?)
87
+ arch_reports_true_for(:_64_bit?, :arm?)
88
88
  end
89
89
  context "on arch64" do
90
90
  let(:arch) { "arch64" }
91
91
 
92
- arch_reports_true_for(:_64_bit?)
92
+ arch_reports_true_for(:_64_bit?, :arm?)
93
93
  end
94
94
  context "on arm64" do
95
95
  let(:arch) { "arm64" }
96
96
 
97
- arch_reports_true_for(:_64_bit?)
97
+ arch_reports_true_for(:_64_bit?, :arm?)
98
98
  end
99
99
  context "on sun4v" do
100
100
  let(:arch) { "sun4v" }
@@ -129,8 +129,19 @@ RSpec.describe ChefUtils::DSL::Architecture do
129
129
  context "on armhf" do
130
130
  let(:arch) { "armhf" }
131
131
 
132
- arch_reports_true_for(:armhf?, :_32_bit?)
132
+ arch_reports_true_for(:armhf?, :_32_bit?, :arm?)
133
+ end
134
+ context "on armv6l" do
135
+ let(:arch) { "armv6l" }
136
+
137
+ arch_reports_true_for(:armhf?, :_32_bit?, :arm?)
138
+ end
139
+ context "on armv7l" do
140
+ let(:arch) { "armv7l" }
141
+
142
+ arch_reports_true_for(:armhf?, :_32_bit?, :arm?)
133
143
  end
144
+
134
145
  context "on s390" do
135
146
  let(:arch) { "s390" }
136
147
 
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,7 @@ RSpec.describe ChefUtils::DSL::Introspection do
21
21
  class IntrospectionTestClass
22
22
  include ChefUtils::DSL::Introspection
23
23
  attr_accessor :node
24
+
24
25
  def initialize(node)
25
26
  @node = node
26
27
  end
@@ -31,7 +32,7 @@ RSpec.describe ChefUtils::DSL::Introspection do
31
32
  let(:test_instance) { IntrospectionTestClass.new(node) }
32
33
 
33
34
  context "#docker?" do
34
- # FIXME: use a real VividMash for these tests insted of stubbing
35
+ # FIXME: use a real VividMash for these tests instead of stubbing
35
36
  it "is false by default" do
36
37
  expect(node).to receive(:read).with("virtualization", "systems", "docker").and_return(nil)
37
38
  expect(ChefUtils.docker?(node)).to be false
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -58,6 +58,7 @@ RSpec.describe ChefUtils::DSL::Platform do
58
58
  class ThingWithANode
59
59
  include ChefUtils::DSL::Platform
60
60
  attr_accessor :node
61
+
61
62
  def initialize(node)
62
63
  @node = node
63
64
  end
@@ -69,6 +70,7 @@ RSpec.describe ChefUtils::DSL::Platform do
69
70
  attr_accessor :node
70
71
  end
71
72
  attr_accessor :run_context
73
+
72
74
  def initialize(node)
73
75
  @run_context = RunContext.new
74
76
  run_context.node = node
@@ -78,6 +80,7 @@ RSpec.describe ChefUtils::DSL::Platform do
78
80
  class ThingWithTheDSL
79
81
  include ChefUtils
80
82
  attr_accessor :node
83
+
81
84
  def initialize(node)
82
85
  @node = node
83
86
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2018-2019, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright 2020, Chef Software Inc.
2
+ # Copyright:: Copyright (c) Chef Software Inc.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Author:: Matthew Kent (<mkent@magoazul.com>)
3
- # Copyright:: Copyright 2011-2016, Chef Software Inc.
3
+ # Copyright:: Copyright (c) Chef Software Inc.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.9.17
4
+ version: 15.13.8
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-04-03 00:00:00.000000000 Z
11
+ date: 2020-07-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: