From ecd41201b51460a1c9f818412795cac43776f470 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 15 Dec 2014 11:02:08 -0800 Subject: [PATCH] Fixes for #218 This commit hides the password when it is changed and fixes a misspelled variable. --- lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb | 4 ++-- lib/puppet/type/rabbitmq_user.rb | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb b/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb index 00a9e0d08..8a8e9f41c 100644 --- a/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb +++ b/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb @@ -42,8 +42,8 @@ def password def check_password - responce = rabbitmqctl('eval', 'rabbit_auth_backend_internal:check_user_login(<<"' + resource[:name] + '">>, [{password, <<"' + resource[:password] +'">>}]).') - if responce.include? 'invalid credentials' + response = rabbitmqctl('eval', 'rabbit_auth_backend_internal:check_user_login(<<"' + resource[:name] + '">>, [{password, <<"' + resource[:password] +'">>}]).') + if response.include? 'invalid credentials' false else true diff --git a/lib/puppet/type/rabbitmq_user.rb b/lib/puppet/type/rabbitmq_user.rb index aae762333..66eef92c2 100644 --- a/lib/puppet/type/rabbitmq_user.rb +++ b/lib/puppet/type/rabbitmq_user.rb @@ -26,6 +26,9 @@ def insync?(is) def set(value) provider.change_password end + def change_to_s(current, desired) + "password has been changed" + end end newproperty(:admin) do