chef 11.14.0.alpha.4 → 11.14.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/CONTRIBUTING.md +0 -4
  2. data/README.md +1 -1
  3. data/distro/common/man/man1/chef-shell.1 +4 -4
  4. data/distro/common/man/man1/knife-bootstrap.1 +14 -11
  5. data/distro/common/man/man1/knife-client.1 +14 -11
  6. data/distro/common/man/man1/knife-configure.1 +7 -7
  7. data/distro/common/man/man1/knife-cookbook-site.1 +23 -23
  8. data/distro/common/man/man1/knife-cookbook.1 +23 -23
  9. data/distro/common/man/man1/knife-data-bag.1 +13 -13
  10. data/distro/common/man/man1/knife-delete.1 +9 -9
  11. data/distro/common/man/man1/knife-deps.1 +9 -9
  12. data/distro/common/man/man1/knife-diff.1 +10 -10
  13. data/distro/common/man/man1/knife-download.1 +9 -9
  14. data/distro/common/man/man1/knife-edit.1 +7 -7
  15. data/distro/common/man/man1/knife-environment.1 +10 -10
  16. data/distro/common/man/man1/knife-exec.1 +7 -7
  17. data/distro/common/man/man1/knife-index-rebuild.1 +1 -1
  18. data/distro/common/man/man1/knife-list.1 +12 -12
  19. data/distro/common/man/man1/knife-node.1 +12 -9
  20. data/distro/common/man/man1/knife-raw.1 +7 -7
  21. data/distro/common/man/man1/knife-recipe-list.1 +1 -1
  22. data/distro/common/man/man1/knife-role.1 +8 -8
  23. data/distro/common/man/man1/knife-search.1 +9 -9
  24. data/distro/common/man/man1/knife-serve.1 +109 -0
  25. data/distro/common/man/man1/knife-show.1 +8 -8
  26. data/distro/common/man/man1/knife-ssh.1 +9 -9
  27. data/distro/common/man/man1/knife-ssl-check.1 +9 -9
  28. data/distro/common/man/man1/knife-ssl-fetch.1 +10 -10
  29. data/distro/common/man/man1/knife-status.1 +9 -9
  30. data/distro/common/man/man1/knife-tag.1 +7 -7
  31. data/distro/common/man/man1/knife-upload.1 +10 -10
  32. data/distro/common/man/man1/knife-user.1 +9 -9
  33. data/distro/common/man/man1/knife-xargs.1 +7 -7
  34. data/distro/common/man/man1/knife.1 +118 -14
  35. data/distro/common/man/man8/chef-client.8 +13 -10
  36. data/distro/common/man/man8/chef-solo.8 +13 -14
  37. data/distro/common/markdown/man1/knife.mkd +1 -1
  38. data/lib/chef/application/knife.rb +1 -1
  39. data/lib/chef/application/windows_service.rb +0 -1
  40. data/lib/chef/chef_fs/file_system.rb +6 -2
  41. data/lib/chef/config.rb +3 -2
  42. data/lib/chef/config_fetcher.rb +1 -1
  43. data/lib/chef/cookbook/metadata.rb +20 -14
  44. data/lib/chef/cookbook/synchronizer.rb +24 -13
  45. data/lib/chef/encrypted_data_bag_item/decryptor.rb +3 -3
  46. data/lib/chef/encrypted_data_bag_item/encryptor.rb +2 -2
  47. data/lib/chef/exceptions.rb +1 -0
  48. data/lib/chef/file_content_management/deploy/mv_windows.rb +1 -1
  49. data/lib/chef/formatters/error_inspectors/resource_failure_inspector.rb +1 -1
  50. data/lib/chef/http.rb +6 -1
  51. data/lib/chef/http/http_request.rb +9 -1
  52. data/lib/chef/http/simple.rb +2 -1
  53. data/lib/chef/json_compat.rb +5 -16
  54. data/lib/chef/knife/bootstrap.rb +2 -0
  55. data/lib/chef/knife/bootstrap/archlinux-gems.erb +2 -2
  56. data/lib/chef/knife/core/object_loader.rb +3 -1
  57. data/lib/chef/knife/ssh.rb +14 -7
  58. data/lib/chef/mixin/convert_to_class_name.rb +1 -0
  59. data/lib/chef/mixin/windows_architecture_helper.rb +24 -4
  60. data/lib/chef/platform/provider_mapping.rb +13 -0
  61. data/lib/chef/provider/env/windows.rb +3 -6
  62. data/lib/chef/provider/git.rb +1 -2
  63. data/lib/chef/provider/log.rb +15 -1
  64. data/lib/chef/provider/package/apt.rb +3 -3
  65. data/lib/chef/provider/package/dpkg.rb +35 -16
  66. data/lib/chef/provider/package/paludis.rb +91 -0
  67. data/lib/chef/provider/package/rpm.rb +3 -2
  68. data/lib/chef/provider/package/yum-dump.py +6 -6
  69. data/lib/chef/provider/package/yum.rb +2 -0
  70. data/lib/chef/provider/registry_key.rb +4 -5
  71. data/lib/chef/provider/remote_file/cache_control_data.rb +1 -1
  72. data/lib/chef/provider/service/solaris.rb +1 -1
  73. data/lib/chef/provider/service/upstart.rb +2 -1
  74. data/lib/chef/provider/service/windows.rb +37 -9
  75. data/lib/chef/provider/user/pw.rb +1 -1
  76. data/lib/chef/provider/user/useradd.rb +1 -1
  77. data/lib/chef/provider/windows_script.rb +2 -1
  78. data/lib/chef/providers.rb +1 -0
  79. data/lib/chef/resource.rb +10 -0
  80. data/lib/chef/resource/file.rb +0 -9
  81. data/lib/chef/resource/package.rb +14 -4
  82. data/lib/chef/resource/paludis_package.rb +33 -0
  83. data/lib/chef/resource/registry_key.rb +62 -3
  84. data/lib/chef/resource/service.rb +21 -4
  85. data/lib/chef/resource_reporter.rb +10 -0
  86. data/lib/chef/resources.rb +1 -0
  87. data/lib/chef/role.rb +14 -10
  88. data/lib/chef/shell.rb +8 -0
  89. data/lib/chef/shell/shell_session.rb +3 -3
  90. data/lib/chef/user.rb +12 -11
  91. data/lib/chef/util/selinux.rb +1 -1
  92. data/lib/chef/version.rb +1 -1
  93. data/lib/chef/version_constraint.rb +6 -5
  94. data/lib/chef/win32/api/process.rb +1 -0
  95. data/lib/chef/win32/api/system.rb +14 -0
  96. data/lib/chef/win32/error.rb +1 -1
  97. data/lib/chef/win32/security.rb +5 -5
  98. data/lib/chef/win32/version.rb +6 -2
  99. data/spec/data/trusted_certs/opscode.pem +57 -35
  100. data/spec/functional/application_spec.rb +2 -2
  101. data/spec/functional/resource/mount_spec.rb +3 -1
  102. data/spec/functional/shell_spec.rb +10 -0
  103. data/spec/functional/tiny_server_spec.rb +2 -2
  104. data/spec/support/chef_helpers.rb +1 -1
  105. data/spec/support/shared/functional/securable_resource.rb +11 -2
  106. data/spec/support/shared/functional/securable_resource_with_reporting.rb +13 -2
  107. data/spec/tiny_server.rb +1 -1
  108. data/spec/unit/config_spec.rb +5 -0
  109. data/spec/unit/cookbook/metadata_spec.rb +24 -0
  110. data/spec/unit/environment_spec.rb +6 -0
  111. data/spec/unit/http/http_request_spec.rb +91 -0
  112. data/spec/unit/http_spec.rb +23 -0
  113. data/spec/unit/knife/bootstrap_spec.rb +2 -2
  114. data/spec/unit/knife/ssh_spec.rb +7 -13
  115. data/spec/unit/knife_spec.rb +1 -1
  116. data/spec/unit/mixin/convert_to_class_name_spec.rb +4 -0
  117. data/spec/unit/provider/git_spec.rb +2 -2
  118. data/spec/unit/provider/log_spec.rb +18 -0
  119. data/spec/unit/provider/mount/solaris_spec.rb +3 -1
  120. data/spec/unit/provider/package/apt_spec.rb +85 -40
  121. data/spec/unit/provider/package/dpkg_spec.rb +24 -48
  122. data/spec/unit/provider/package/paludis_spec.rb +135 -0
  123. data/spec/unit/provider/package/rpm_spec.rb +40 -32
  124. data/spec/unit/provider/package/yum_spec.rb +11 -4
  125. data/spec/unit/provider/registry_key_spec.rb +67 -53
  126. data/spec/unit/provider/remote_file/cache_control_data_spec.rb +10 -1
  127. data/spec/unit/provider/service/solaris_smf_service_spec.rb +23 -2
  128. data/spec/unit/provider/service/upstart_service_spec.rb +7 -0
  129. data/spec/unit/provider/service/windows_spec.rb +72 -0
  130. data/spec/unit/provider/user/pw_spec.rb +21 -4
  131. data/spec/unit/provider/user/useradd_spec.rb +10 -0
  132. data/spec/unit/resource/package_spec.rb +26 -18
  133. data/spec/unit/resource/registry_key_spec.rb +28 -0
  134. data/spec/unit/resource/service_spec.rb +14 -0
  135. data/spec/unit/resource_reporter_spec.rb +37 -12
  136. data/spec/unit/resource_spec.rb +41 -6
  137. data/spec/unit/rest_spec.rb +2 -2
  138. data/spec/unit/role_spec.rb +46 -28
  139. data/spec/unit/shell/shell_session_spec.rb +42 -2
  140. data/spec/unit/shell_spec.rb +1 -1
  141. data/spec/unit/user_spec.rb +12 -0
  142. data/spec/unit/util/selinux_spec.rb +4 -4
  143. data/spec/unit/version_constraint_spec.rb +14 -2
  144. metadata +195 -161
  145. checksums.yaml +0 -7
@@ -42,9 +42,14 @@ class Chef
42
42
  @reload_command = nil
43
43
  @init_command = nil
44
44
  @priority = nil
45
+ @timeout = nil
45
46
  @action = "nothing"
46
47
  @supports = { :restart => false, :reload => false, :status => false }
47
48
  @allowed_actions.push(:enable, :disable, :start, :stop, :restart, :reload)
49
+
50
+ if(run_context && run_context.node[:init_package] == "systemd")
51
+ @provider = Chef::Provider::Service::Systemd
52
+ end
48
53
  end
49
54
 
50
55
  def service_name(arg=nil)
@@ -150,16 +155,28 @@ class Chef
150
155
  # similar for other runlevels
151
156
  #
152
157
  def priority(arg=nil)
153
- set_or_return(:priority,
154
- arg,
155
- :kind_of => [ Integer, String, Hash ])
158
+ set_or_return(
159
+ :priority,
160
+ arg,
161
+ :kind_of => [ Integer, String, Hash ]
162
+ )
163
+ end
164
+
165
+ # timeout only applies to the windows service manager
166
+ def timeout(arg=nil)
167
+ set_or_return(
168
+ :timeout,
169
+ arg,
170
+ :kind_of => Integer
171
+ )
156
172
  end
157
173
 
158
174
  def parameters(arg=nil)
159
175
  set_or_return(
160
176
  :parameters,
161
177
  arg,
162
- :kind_of => [ Hash ] )
178
+ :kind_of => [ Hash ]
179
+ )
163
180
  end
164
181
 
165
182
  def supports(args={})
@@ -47,6 +47,16 @@ class Chef
47
47
  report
48
48
  end
49
49
 
50
+ # Future: Some resources store state information that does not convert nicely
51
+ # to json. We can't call a resource's state method here, since there are conflicts
52
+ # with some LWRPs, so we can't override a resource's state method to return
53
+ # json-friendly state data.
54
+ #
55
+ # The registry key resource returns json-friendly state data through its state
56
+ # attribute, and uses a read-only variable for fetching true state data. If
57
+ # we have conflicts with other resources reporting json incompatible state, we
58
+ # may want to extend the state_attrs API with the ability to rename POST'd
59
+ # attrs.
50
60
  def for_json
51
61
  as_hash = {}
52
62
  as_hash["type"] = new_resource.class.dsl_name
@@ -48,6 +48,7 @@ require 'chef/resource/mount'
48
48
  require 'chef/resource/ohai'
49
49
  require 'chef/resource/package'
50
50
  require 'chef/resource/pacman_package'
51
+ require 'chef/resource/paludis_package'
51
52
  require 'chef/resource/perl'
52
53
  require 'chef/resource/portage_package'
53
54
  require 'chef/resource/powershell_script'
@@ -231,21 +231,25 @@ class Chef
231
231
  end
232
232
 
233
233
  # Load a role from disk - prefers to load the JSON, but will happily load
234
- # the raw rb files as well.
235
- def self.from_disk(name, force=nil)
234
+ # the raw rb files as well. Can search within directories in the role_path.
235
+ def self.from_disk(name)
236
236
  paths = Array(Chef::Config[:role_path])
237
+ paths.each do |path|
238
+ roles_files = Dir.glob(File.join(path, "**", "**"))
239
+ js_files = roles_files.select { |file| file.match /#{name}\.json$/ }
240
+ rb_files = roles_files.select { |file| file.match /#{name}\.rb$/ }
241
+ if js_files.count > 1 or rb_files.count > 1
242
+ raise Chef::Exceptions::DuplicateRole, "Multiple roles of same type found named #{name}"
243
+ end
244
+ js_path, rb_path = js_files.first, rb_files.first
237
245
 
238
- paths.each do |p|
239
- js_file = File.join(p, "#{name}.json")
240
- rb_file = File.join(p, "#{name}.rb")
241
-
242
- if File.exists?(js_file) || force == "json"
246
+ if js_path && File.exists?(js_path)
243
247
  # from_json returns object.class => json_class in the JSON.
244
- return Chef::JSONCompat.from_json(IO.read(js_file))
245
- elsif File.exists?(rb_file) || force == "ruby"
248
+ return Chef::JSONCompat.from_json(IO.read(js_path))
249
+ elsif rb_path && File.exists?(rb_path)
246
250
  role = Chef::Role.new
247
251
  role.name(name)
248
- role.from_file(rb_file)
252
+ role.from_file(rb_path)
249
253
  return role
250
254
  end
251
255
  end
@@ -53,6 +53,7 @@ module Shell
53
53
  IRB::ExtendCommandBundle.instance_variable_get(:@ALIASES).delete(irb_help)
54
54
 
55
55
  parse_opts
56
+ Chef::Config[:shell_config] = options.config
56
57
 
57
58
  # HACK: this duplicates the functions of IRB.start, but we have to do it
58
59
  # to get access to the main object before irb starts.
@@ -111,6 +112,7 @@ module Shell
111
112
  conf.prompt_i = "chef#{leader(m)} > "
112
113
  conf.prompt_n = "chef#{leader(m)} ?> "
113
114
  conf.prompt_s = "chef#{leader(m)}%l> "
115
+ conf.use_tracer = false
114
116
  end
115
117
  end
116
118
 
@@ -257,6 +259,12 @@ FOOTER
257
259
  :proc => lambda {|v| puts "Chef: #{::Chef::VERSION}"},
258
260
  :exit => 0
259
261
 
262
+ option :override_runlist,
263
+ :short => "-o RunlistItem,RunlistItem...",
264
+ :long => "--override-runlist RunlistItem,RunlistItem...",
265
+ :description => "Replace current run list with specified items",
266
+ :proc => lambda { |items| items.split(',').map { |item| Chef::RunList::RunListItem.new(item) }}
267
+
260
268
  def self.print_help
261
269
  instance = new
262
270
  instance.parse_options([])
@@ -151,7 +151,7 @@ module Shell
151
151
 
152
152
  def rebuild_node
153
153
  Chef::Config[:solo] = true
154
- @client = Chef::Client.new
154
+ @client = Chef::Client.new(nil, Chef::Config[:shell_config])
155
155
  @client.run_ohai
156
156
  @client.load_node
157
157
  @client.build_node
@@ -183,7 +183,7 @@ module Shell
183
183
  def rebuild_node
184
184
  # Tell the client we're chef solo so it won't try to contact the server
185
185
  Chef::Config[:solo] = true
186
- @client = Chef::Client.new
186
+ @client = Chef::Client.new(nil, Chef::Config[:shell_config])
187
187
  @client.run_ohai
188
188
  @client.load_node
189
189
  @client.build_node
@@ -214,7 +214,7 @@ module Shell
214
214
  def rebuild_node
215
215
  # Make sure the client knows this is not chef solo
216
216
  Chef::Config[:solo] = false
217
- @client = Chef::Client.new
217
+ @client = Chef::Client.new(nil, Chef::Config[:shell_config])
218
218
  @client.run_ohai
219
219
  @client.register
220
220
  @client.load_node
@@ -144,18 +144,19 @@ class Chef
144
144
  end
145
145
 
146
146
  def self.list(inflate=false)
147
- response = if inflate
148
- users = Chef::REST.new(Chef::Config[:chef_server_url]).get_rest('users')
149
- users.map do |name|
150
- Chef::User.load(name)
151
- end
152
- else
153
- Chef::REST.new(Chef::Config[:chef_server_url]).get_rest('users')
154
- end
155
- if response.is_a? Array
156
- transform_ohc_list_response(response)
147
+ response = Chef::REST.new(Chef::Config[:chef_server_url]).get_rest('users')
148
+ users = if response.is_a?(Array)
149
+ transform_ohc_list_response(response) # OHC/OPC
157
150
  else
158
- response
151
+ response # OSC
152
+ end
153
+ if inflate
154
+ users.inject({}) do |user_map, (name, _url)|
155
+ user_map[name] = Chef::User.load(name)
156
+ user_map
157
+ end
158
+ else
159
+ users
159
160
  end
160
161
  end
161
162
 
@@ -47,7 +47,7 @@ class Chef
47
47
  def restore_security_context(file_path, recursive = false)
48
48
  if restorecon_path
49
49
  restorecon_command = recursive ? "#{restorecon_path} -R -r" : "#{restorecon_path} -R"
50
- restorecon_command += " #{file_path}"
50
+ restorecon_command += " \"#{file_path}\""
51
51
  Chef::Log.debug("Restoring selinux security content with #{restorecon_command}")
52
52
  shell_out!(restorecon_command)
53
53
  else
@@ -17,7 +17,7 @@
17
17
 
18
18
  class Chef
19
19
  CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
- VERSION = '11.14.0.alpha.4'
20
+ VERSION = '11.14.0.rc.2'
21
21
  end
22
22
 
23
23
  # NOTE: the Chef::Version class is defined in version_class.rb
@@ -21,10 +21,10 @@ class Chef
21
21
  DEFAULT_CONSTRAINT = ">= 0.0.0"
22
22
  STANDARD_OPS = %w(< > <= >=)
23
23
  OPS = %w(< > = <= >= ~>)
24
- PATTERN = /^(#{OPS.join('|')}) (.+)$/
24
+ PATTERN = /^(#{OPS.join('|')}) *([0-9].*)$/
25
25
  VERSION_CLASS = Chef::Version
26
26
 
27
- attr_reader :op, :version
27
+ attr_reader :op, :version, :raw_version
28
28
 
29
29
  def initialize(constraint_spec=DEFAULT_CONSTRAINT)
30
30
  case constraint_spec
@@ -99,12 +99,13 @@ class Chef
99
99
  @missing_patch_level = false
100
100
  if str.index(" ").nil? && str =~ /^[0-9]/
101
101
  # try for lone version, implied '='
102
- @version = self.class::VERSION_CLASS.new(str)
102
+ @raw_version = str
103
+ @version = self.class::VERSION_CLASS.new(@raw_version)
103
104
  @op = "="
104
105
  elsif PATTERN.match str
105
106
  @op = $1
106
- raw_version = $2
107
- @version = self.class::VERSION_CLASS.new(raw_version)
107
+ @raw_version = $2
108
+ @version = self.class::VERSION_CLASS.new(@raw_version)
108
109
  if raw_version.split('.').size <= 2
109
110
  @missing_patch_level = true
110
111
  end
@@ -34,6 +34,7 @@ class Chef
34
34
  safe_attach_function :GetProcessHandleCount, [ :HANDLE, :LPDWORD ], :BOOL
35
35
  safe_attach_function :GetProcessId, [ :HANDLE ], :DWORD
36
36
  safe_attach_function :CloseHandle, [ :HANDLE ], :BOOL
37
+ safe_attach_function :IsWow64Process, [ :HANDLE, :PBOOL ], :BOOL
37
38
 
38
39
  end
39
40
  end
@@ -186,6 +186,20 @@ int WINAPI GetSystemMetrics(
186
186
  =end
187
187
  safe_attach_function :GetSystemMetrics, [:int], :int
188
188
 
189
+ =begin
190
+ LRESULT WINAPI SendMessageTimeout(
191
+ _In_ HWND hWnd,
192
+ _In_ UINT Msg,
193
+ _In_ WPARAM wParam,
194
+ _In_ LPARAM lParam,
195
+ _In_ UINT fuFlags,
196
+ _In_ UINT uTimeout,
197
+ _Out_opt_ PDWORD_PTR lpdwResult
198
+ );
199
+ =end
200
+ safe_attach_function :SendMessageTimeoutW, [:HWND, :UINT, :WPARAM, :LPARAM, :UINT, :UINT, :PDWORD_PTR], :LRESULT
201
+ safe_attach_function :SendMessageTimeoutA, [:HWND, :UINT, :WPARAM, :LPARAM, :UINT, :UINT, :PDWORD_PTR], :LRESULT
202
+
189
203
  end
190
204
  end
191
205
  end
@@ -47,7 +47,7 @@ class Chef
47
47
  end
48
48
 
49
49
  def self.get_last_error
50
- GetLastError()
50
+ FFI::LastError.error
51
51
  end
52
52
 
53
53
  # Raises the last error. This should only be called by
@@ -262,7 +262,7 @@ class Chef
262
262
  system_name = system_name.to_wstring if system_name
263
263
  if LookupAccountNameW(system_name, name.to_wstring, nil, sid_size, nil, referenced_domain_name_size, nil)
264
264
  raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountName, and got no error!"
265
- elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER
265
+ elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER
266
266
  Chef::ReservedNames::Win32::Error.raise!
267
267
  end
268
268
 
@@ -284,7 +284,7 @@ class Chef
284
284
  system_name = system_name.to_wstring if system_name
285
285
  if LookupAccountSidW(system_name, sid, nil, name_size, nil, referenced_domain_name_size, nil)
286
286
  raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountSid, and got no error!"
287
- elsif Chef::ReservedNames::Win32::Error::get_last_error != ERROR_INSUFFICIENT_BUFFER
287
+ elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER
288
288
  Chef::ReservedNames::Win32::Error.raise!
289
289
  end
290
290
 
@@ -303,7 +303,7 @@ class Chef
303
303
  name_size = FFI::Buffer.new(:long).write_long(0)
304
304
  if LookupPrivilegeNameW(system_name, luid, nil, name_size)
305
305
  raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupPrivilegeName, and got no error!"
306
- elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER
306
+ elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER
307
307
  Chef::ReservedNames::Win32::Error.raise!
308
308
  end
309
309
 
@@ -321,7 +321,7 @@ class Chef
321
321
  language_id = FFI::Buffer.new(:long)
322
322
  if LookupPrivilegeDisplayNameW(system_name, name.to_wstring, nil, display_name_size, language_id)
323
323
  raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupPrivilegeDisplayName, and got no error!"
324
- elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER
324
+ elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER
325
325
  Chef::ReservedNames::Win32::Error.raise!
326
326
  end
327
327
 
@@ -353,7 +353,7 @@ class Chef
353
353
  group_size = FFI::Buffer.new(:long).write_long(0)
354
354
  if MakeAbsoluteSD(security_descriptor, nil, absolute_sd_size, nil, dacl_size, nil, sacl_size, nil, owner_size, nil, group_size)
355
355
  raise "Expected ERROR_INSUFFICIENT_BUFFER from MakeAbsoluteSD, and got no error!"
356
- elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER
356
+ elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER
357
357
  Chef::ReservedNames::Win32::Error.raise!
358
358
  end
359
359
 
@@ -23,6 +23,10 @@ require 'wmi-lite/wmi'
23
23
  class Chef
24
24
  module ReservedNames::Win32
25
25
  class Version
26
+ class << self
27
+ include Chef::ReservedNames::Win32::API::System
28
+ end
29
+
26
30
  include Chef::ReservedNames::Win32::API::Macros
27
31
  include Chef::ReservedNames::Win32::API::System
28
32
 
@@ -33,12 +37,12 @@ class Chef
33
37
  private
34
38
 
35
39
  def self.get_system_metrics(n_index)
36
- Win32API.new('user32', 'GetSystemMetrics', 'I', 'I').call(n_index)
40
+ GetSystemMetrics(n_index)
37
41
  end
38
42
 
39
43
  def self.method_name_from_marketing_name(marketing_name)
40
44
  "#{marketing_name.gsub(/\s/, '_').gsub(/\./, '_').downcase}?"
41
- # "#{marketing_name.gsub(/\s/, '_').gsub(//, '_').downcase}?"
45
+ # "#{marketing_name.gsub(/\s/, '_').gsub(//, '_').downcase}?"
42
46
  end
43
47
 
44
48
  public
@@ -1,38 +1,60 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIGqjCCBZKgAwIBAgIQCJlQhNSTz1z3zHZb972KvDANBgkqhkiG9w0BAQUFADBI
2
+ MIIFrDCCBJSgAwIBAgIQB1O/fCb6cEytJ4BP3HTbCTANBgkqhkiG9w0BAQUFADBI
3
3
  MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSIwIAYDVQQDExlE
4
- aWdpQ2VydCBTZWN1cmUgU2VydmVyIENBMB4XDTEzMDQxMjAwMDAwMFoXDTE0MDYx
5
- NjEyMDAwMFowYzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24x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