From: Elliott Davis Date: Tue, 13 Jan 2015 14:06:07 +0000 (-0600) Subject: Moved constant QUORUM_STATES into function. X-Git-Tag: v0.8.0~8^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19ec0763280fa667ff5cbe499d9f9ec712f08033;p=ceph-cookbooks.git 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 --- 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.