lib/chef/knife/bootstrap_windows_winrm.rb in knife-windows-0.6.0 vs lib/chef/knife/bootstrap_windows_winrm.rb in knife-windows-0.8.0.rc.0
- old
+ new
@@ -39,10 +39,11 @@
def run
bootstrap
end
+
def run_command(command = '')
winrm = Chef::Knife::Winrm.new
winrm.name_args = [ server_name, command ]
winrm.config[:winrm_user] = locate_config_value(:winrm_user)
winrm.config[:winrm_password] = locate_config_value(:winrm_password)
@@ -52,10 +53,14 @@
winrm.config[:kerberos_service] = Chef::Config[:knife][:kerberos_service] if Chef::Config[:knife][:kerberos_service]
winrm.config[:ca_trust_file] = Chef::Config[:knife][:ca_trust_file] if Chef::Config[:knife][:ca_trust_file]
winrm.config[:manual] = true
winrm.config[:winrm_port] = locate_config_value(:winrm_port)
winrm.config[:suppress_auth_failure] = true
- winrm.config[:returns] = nil
+
+ #If you turn off the return flag, then winrm.run won't atually check and
+ #return the error
+ #codes. Otherwise, it ignores the return value of the server call.
+ winrm.config[:returns] = "0"
winrm.run
end
protected