lib/chef/knife/winrm_session.rb in knife-windows-3.0.6 vs lib/chef/knife/winrm_session.rb in knife-windows-3.0.10

- old
+ new

@@ -14,13 +14,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -require 'chef/application' -require 'winrm' -require 'winrm-elevated' +require "chef/application" +require "winrm" +require "winrm-elevated" class Chef class Knife class WinrmSession attr_reader :host, :endpoint, :port, :output, :error, :exit_code @@ -32,24 +32,24 @@ @port = options[:port] @user = options[:user] @shell_args = [ options[:shell] ] @shell_args << { codepage: options[:codepage] } if options[:shell] == :cmd url = "#{options[:host]}:#{options[:port]}/wsman" - scheme = options[:transport] == :ssl ? 'https' : 'http' + scheme = options[:transport] == :ssl ? "https" : "http" @endpoint = "#{scheme}://#{url}" - opts = Hash.new + opts = {} opts = { user: @user, password: options[:password], basic_auth_only: options[:basic_auth_only], disable_sspi: options[:disable_sspi], no_ssl_peer_verification: options[:no_ssl_peer_verification], ssl_peer_fingerprint: options[:ssl_peer_fingerprint], endpoint: endpoint, - transport: options[:transport] + transport: options[:transport], } - options[:transport] == :kerberos ? opts.merge!({:service => options[:service], :realm => options[:realm]}) : opts.merge!({:ca_trust_path => options[:ca_trust_path]}) + options[:transport] == :kerberos ? opts.merge!({ service: options[:service], realm: options[:realm] }) : opts.merge!({ ca_trust_path: options[:ca_trust_path] }) opts[:operation_timeout] = options[:operation_timeout] if options[:operation_timeout] Chef::Log.debug("WinRM::WinRMWebService options: #{opts}") Chef::Log.debug("Endpoint: #{endpoint}") Chef::Log.debug("Transport: #{options[:transport]}")