summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornimisha <nimisha.sharad@msystechnologies.com>2017-02-24 18:46:51 +0530
committerBryan McLellan <btm@loftninjas.org>2017-09-05 20:09:30 -0400
commit24de354c67305563f677080c03b8892c4a9e0fb1 (patch)
tree9e3657586d78f843aa3e139ecccba9d67e72efaf /lib
parent35f4cafac60770b59853d7e12b418f1971d234db (diff)
downloadchef-24de354c67305563f677080c03b8892c4a9e0fb1.tar.gz
Fixing specs
Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/mixin/user_context.rb2
-rw-r--r--lib/chef/provider/remote_file.rb2
-rw-r--r--lib/chef/provider/remote_file/fetcher.rb2
-rw-r--r--lib/chef/util/windows/logon_session.rb8
4 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/mixin/user_context.rb b/lib/chef/mixin/user_context.rb
index a8f7c4bd9c..40a72912a3 100644
--- a/lib/chef/mixin/user_context.rb
+++ b/lib/chef/mixin/user_context.rb
@@ -24,7 +24,7 @@ class Chef
def with_user_context(user, password, domain = nil, &block)
if node["platform_family"] != "windows"
- raise Exceptions::UnsupportedPlatform, "User context impersonation is supported only on the Windows platform"
+ raise Exceptions::UnsupportedPlatform, "User context impersonation is supported only on the Windows platform"
end
if ! block_given?
diff --git a/lib/chef/provider/remote_file.rb b/lib/chef/provider/remote_file.rb
index c692984bc0..d2de3d0b5f 100644
--- a/lib/chef/provider/remote_file.rb
+++ b/lib/chef/provider/remote_file.rb
@@ -44,6 +44,8 @@ class Chef
a.whyrun("Assuming that the platform is Windows while passing 'remote_user', 'remote_domain' and 'remote_password' properties")
end
end
+
+ super
end
def load_current_resource
diff --git a/lib/chef/provider/remote_file/fetcher.rb b/lib/chef/provider/remote_file/fetcher.rb
index 6a4711d097..3011dd80a0 100644
--- a/lib/chef/provider/remote_file/fetcher.rb
+++ b/lib/chef/provider/remote_file/fetcher.rb
@@ -25,7 +25,7 @@ class Chef
def self.for_resource(uri, new_resource, current_resource)
if network_share?(uri)
if !Chef::Platform.windows?
- raise Exceptions::UnsupportedPlatform, "Fetching the file on a network share is supported only on the Windows platform. Please change your source: #{uri}"
+ raise Exceptions::UnsupportedPlatform, "Fetching the file on a network share is supported only on the Windows platform. Please change your source: #{uri}"
end
Chef::Provider::RemoteFile::NetworkFile.new(uri, new_resource, current_resource)
else
diff --git a/lib/chef/util/windows/logon_session.rb b/lib/chef/util/windows/logon_session.rb
index 6ef49e96a3..adabdbb3ef 100644
--- a/lib/chef/util/windows/logon_session.rb
+++ b/lib/chef/util/windows/logon_session.rb
@@ -40,7 +40,7 @@ class Chef
def open
if session_opened
- raise RuntimeError, "Attempted to open a logon session that was already open."
+ raise "Attempted to open a logon session that was already open."
end
username = wstring(original_username)
@@ -73,11 +73,11 @@ class Chef
validate_session_open!
if ! session_opened
- raise RuntimeError, "Attempted to set the user context before opening a session."
+ raise "Attempted to set the user context before opening a session."
end
if impersonating
- raise RuntimeError, "Attempt to set the user context when the user context is already set."
+ raise "Attempt to set the user context when the user context is already set."
end
status = Chef::ReservedNames::Win32::API::Security.ImpersonateLoggedOnUser(token.read_ulong)
@@ -117,7 +117,7 @@ class Chef
def validate_session_open!
if ! session_opened
- raise RuntimeError, "Attempted to set the user context before opening a session."
+ raise "Attempted to set the user context before opening a session."
end
end
end