Skip to content

Commit

Permalink
Merge pull request #13719 from cben/connect
Browse files Browse the repository at this point in the history
Container managers #connect: don't mutate argument
  • Loading branch information
blomquisg authored Feb 16, 2017
2 parents fad636d + 722ab81 commit f98d899
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ def verify_ssl_mode
end

def connect(options = {})
options[:hostname] ||= address
options[:port] ||= port
options[:user] ||= authentication_userid(options[:auth_type])
options[:pass] ||= authentication_password(options[:auth_type])
options[:bearer] ||= authentication_token(options[:auth_type] || 'bearer')
self.class.raw_connect(options[:hostname], options[:port], options)
effective_options = options.merge(
:hostname => options[:hostname] || address,
:port => options[:port] || port,
:user => options[:user] || authentication_userid(options[:auth_type]),
:pass => options[:pass] || authentication_password(options[:auth_type]),
:bearer => options[:bearer] || authentication_token(options[:auth_type] || 'bearer'),
)
self.class.raw_connect(effective_options[:hostname], effective_options[:port], effective_options)
end

def authentications_to_validate
Expand Down

0 comments on commit f98d899

Please sign in to comment.