From 19ec0763280fa667ff5cbe499d9f9ec712f08033 Mon Sep 17 00:00:00 2001 From: Elliott Davis Date: Tue, 13 Jan 2015 08:06:07 -0600 Subject: [PATCH] Moved constant QUORUM_STATES into function. This variable being a global makes chefspec lose it's mind. Updated to remove constant in favor of local variable in function --- libraries/default.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/default.rb b/libraries/default.rb index ce15d6d..29b3ca6 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -149,7 +149,6 @@ def quorum_members_ips mon_ips end -QUORUM_STATES = %w(leader, peon) def quorum? # "ceph auth get-or-create-key" would hang if the monitor wasn't # in quorum yet, which is highly likely on the first run. This @@ -160,13 +159,14 @@ def quorum? # in the ceph tool, this exits immediately if the ceph-mon is not # running for any reason; trying to connect via TCP/IP would wait # for a relatively long timeout. + quorum_states = %w(leader, peon) cmd = Mixlib::ShellOut.new("ceph --admin-daemon /var/run/ceph/ceph-mon.#{node['hostname']}.asok mon_status") cmd.run_command cmd.error! state = JSON.parse(cmd.stdout)['state'] - QUORUM_STATES.include?(state) + quorum_states.include?(state) end # Cephx is on by default, but users can disable it. -- 2.47.3