summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-10-18 16:12:58 -0700
committerTim Smith <tsmith@chef.io>2017-10-19 15:07:13 -0700
commit90e6ac9a899f6aae856b661f7c8a835aa0ba5c22 (patch)
tree3e0274d0a6650ac090e0bce6c7fc4fecbc1a8a9a /lib/chef/mixin
parent25dd1d9dadb68224f600aabc7d05326acfef4d27 (diff)
downloadchef-90e6ac9a899f6aae856b661f7c8a835aa0ba5c22.tar.gz
Fix remote_file with UNC paths failingnodes_not_here
Our check here to see if we're on Windows uses node data that's not available in this context. Use the same Chef::Platform.windows? check we use above. Without this you get the following error: [2017-10-02T21:40:42+00:00] DEBUG: Re-raising exception: NameError - remote_file[c:/foo/bar] (foo::default line 14) had an error: NameError: undefined local variable or method `node' for #<Chef::Provider::RemoteFile::NetworkFile:0x00000000064c0148> Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/user_context.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/mixin/user_context.rb b/lib/chef/mixin/user_context.rb
index 40a72912a3..526d6b0f3f 100644
--- a/lib/chef/mixin/user_context.rb
+++ b/lib/chef/mixin/user_context.rb
@@ -23,7 +23,7 @@ class Chef
module UserContext
def with_user_context(user, password, domain = nil, &block)
- if node["platform_family"] != "windows"
+ unless Chef::Platform.windows?
raise Exceptions::UnsupportedPlatform, "User context impersonation is supported only on the Windows platform"
end