chef-config 18.4.2 → 18.5.0

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: 13c6d37a7819f356c92a27d842fc694cb907d3022502f89fb85548c577f98d91
4
- data.tar.gz: 226bab3a46eca66ec03360cdeeaf54108005662d88d5edad625b330b1c911748
3
+ metadata.gz: ddcbcd4feef547cdfe1ea8628092044d92f0200303a6996678ac5b61d799e56f
4
+ data.tar.gz: 0cc8b36b0817c182995149b254772e602ed3faa4f0e1d9849226415429b79fd3
5
5
  SHA512:
6
- metadata.gz: 783a3784b6956338d6906863e4d672487e0aa4a2ddd573e9866f76d86a37897c60ec45ccaa6cef1b12e73d415e0197fc4f1fde70e416b3d730ea623848fbe7ac
7
- data.tar.gz: b07b2e6c888a794a41edd7492150e7a1aff58fc6a397481e5c9122b62863a82cdc6113ad37d340b9eb8b4b8e8465cb9b0cb631967677af4b5bb6de7eb74cee0b
6
+ metadata.gz: 5065a64b8417cae75b3014a3d76a14dc51d763177df6c2ce15dc12b515a2c093b1f4e1d560f9ffb3001868727b334071ed4335d4ae354f40d008d79f2f1377bd
7
+ data.tar.gz: 649833ca804c13b87a35e62e1537bfd3aa84714a187841d32044072053174f74db600f29e7ce801193ddef6037338bf958a2380ff8392482cf3d15378d518383
@@ -97,8 +97,11 @@ module ChefConfig
97
97
  # @return [String] the platform-specific path
98
98
  #
99
99
  def self.var_chef_dir(windows: ChefUtils.windows?)
100
- path = windows ? c_chef_dir : PathHelper.join("/var", ChefUtils::Dist::Infra::DIR_SUFFIX, windows: windows)
101
- PathHelper.cleanpath(path, windows: windows)
100
+ @var_chef_dir ||= {}
101
+ @var_chef_dir[windows] ||= begin
102
+ path = windows ? c_chef_dir : PathHelper.join("/var", ChefUtils::Dist::Infra::DIR_SUFFIX, windows: windows)
103
+ PathHelper.cleanpath(path, windows: windows)
104
+ end
102
105
  end
103
106
 
104
107
  # On *nix, /var, on Windows C:\
@@ -107,8 +110,11 @@ module ChefConfig
107
110
  # @return [String] the platform-specific path
108
111
  #
109
112
  def self.var_root_dir(windows: ChefUtils.windows?)
110
- path = windows ? "C:\\" : "/var"
111
- PathHelper.cleanpath(path, windows: windows)
113
+ @var_root_dir ||= {}
114
+ @var_root_dir[windows] ||= begin
115
+ path = windows ? "C:\\" : "/var"
116
+ PathHelper.cleanpath(path, windows: windows)
117
+ end
112
118
  end
113
119
 
114
120
  # On windows, C:/chef/
@@ -415,7 +421,14 @@ module ChefConfig
415
421
  # If your `file_cache_path` resides on a NFS (or non-flock()-supporting
416
422
  # fs), it's recommended to set this to something like
417
423
  # '/tmp/chef-client-running.pid'
418
- default(:lockfile) { PathHelper.join(file_cache_path, "#{ChefUtils::Dist::Infra::CLIENT}-running.pid") }
424
+ # In Target Mode, the node name will be used as a prefix to allow
425
+ # parallel execution of Chef against different targets
426
+ default(:lockfile) do
427
+ prefix = ""
428
+ prefix = "#{ChefConfig::Config.node_name}-" if ChefConfig::Config.target_mode?
429
+
430
+ PathHelper.join(file_cache_path, "#{prefix}#{ChefUtils::Dist::Infra::CLIENT}-running.pid")
431
+ end
419
432
 
420
433
  ## Daemonization Settings ##
421
434
  # What user should Chef run as?
@@ -1047,16 +1060,6 @@ module ChefConfig
1047
1060
  default :blocked_normal_attributes, nil
1048
1061
  default :blocked_override_attributes, nil
1049
1062
 
1050
- # deprecated config options that will be removed in Chef Infra Client 18
1051
- default :automatic_attribute_blacklist, nil
1052
- default :default_attribute_blacklist, nil
1053
- default :normal_attribute_blacklist, nil
1054
- default :override_attribute_blacklist, nil
1055
- default :automatic_attribute_whitelist, nil
1056
- default :default_attribute_whitelist, nil
1057
- default :normal_attribute_whitelist, nil
1058
- default :override_attribute_whitelist, nil
1059
-
1060
1063
  # Pull down all the rubygems versions from rubygems and cache them the first time we do a gem_package or
1061
1064
  # chef_gem install. This is memory-expensive and will grow without bounds, but will reduce network
1062
1065
  # round trips.
@@ -54,6 +54,8 @@ module ChefConfig
54
54
  # @since 14.4
55
55
  # @return [String]
56
56
  def credentials_file_path
57
+ return Chef::Config[:credentials] if defined?(Chef::Config) && Chef::Config.key?(:credentials)
58
+
57
59
  PathHelper.home(ChefUtils::Dist::Infra::USER_CONF_DIR, "credentials").freeze
58
60
  end
59
61
 
@@ -59,11 +59,14 @@ module ChefConfig
59
59
  path_separator_regex = Regexp.escape(windows ? "#{File::SEPARATOR}#{BACKSLASH}" : File::SEPARATOR)
60
60
  trailing_slashes_regex = /[#{path_separator_regex}]+$/.freeze
61
61
  leading_slashes_regex = /^[#{path_separator_regex}]+/.freeze
62
+ separator = path_separator(windows: windows)
62
63
 
63
- args.flatten.inject do |joined_path, component|
64
+ args.flatten!
65
+ args.inject do |joined_path, component|
64
66
  joined_path = joined_path.sub(trailing_slashes_regex, "")
65
67
  component = component.sub(leading_slashes_regex, "")
66
- joined_path + "#{path_separator(windows: windows)}#{component}"
68
+ joined_path << "#{separator}#{component}"
69
+ joined_path
67
70
  end
68
71
  end
69
72
 
@@ -248,7 +251,7 @@ module ChefConfig
248
251
  paths << ENV[@@per_tool_home_environment] if defined?(@@per_tool_home_environment) && @@per_tool_home_environment && ENV[@@per_tool_home_environment]
249
252
  paths << ENV["CHEF_HOME"] if ENV["CHEF_HOME"]
250
253
  if windows
251
- # By default, Ruby uses the the following environment variables to determine Dir.home:
254
+ # By default, Ruby uses the following environment variables to determine Dir.home:
252
255
  # HOME
253
256
  # HOMEDRIVE HOMEPATH
254
257
  # USERPROFILE
@@ -15,5 +15,5 @@
15
15
 
16
16
  module ChefConfig
17
17
  CHEFCONFIG_ROOT = File.expand_path("..", __dir__)
18
- VERSION = "18.4.2".freeze
18
+ VERSION = "18.5.0".freeze
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.4.2
4
+ version: 18.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-19 00:00:00.000000000 Z
11
+ date: 2024-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-utils
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 18.4.2
19
+ version: 18.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 18.4.2
26
+ version: 18.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-shellout
29
29
  requirement: !ruby/object:Gem::Requirement