lib/gratan/client.rb in gratan-0.3.0 vs lib/gratan/client.rb in gratan-0.3.1.beta
- old
+ new
@@ -1,6 +1,8 @@
class Gratan::Client
+ include Gratan::Logger::Helper
+
def initialize(options = {})
@options = options
@options[:identifier] ||= Gratan::Identifier::Null.new
client = Mysql2::Client.new(options)
@driver = Gratan::Driver.new(client, options)
@@ -128,10 +130,14 @@
walk_required(user, host, expected_options[:required], actual_options[:required])
end
def walk_identified(user, host, expected_identified, actual_identified)
- if expected_identified != actual_identified
+ if actual_identified == 'PASSWORD <secret>'
+ unless @options[:ignore_password_secret]
+ log(:warn, "cannot change the password (`PASSWORD <secret>`)", :color => :yellow)
+ end
+ elsif expected_identified != actual_identified
@driver.identify(user, host, expected_identified)
update!
end
end