Merge "Sort the results"

This commit is contained in:
Jenkins 2013-07-13 19:45:55 +00:00 committed by Gerrit Code Review
commit 8dc0fd90cd
3 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ if node["openstack"]["mq"]["cluster"]
qs = "roles:#{rabbit_server_role} AND chef_environment:#{node.chef_environment}"
node.override["rabbitmq"]["cluster_disk_nodes"] = search(:node, qs).map do |n|
"#{user}@#{n['hostname']}"
end
end.sort
end
include_recipe "rabbitmq"

View File

@ -36,7 +36,7 @@ describe "openstack-ops-messaging::rabbitmq-server" do
)
end
it "overrides cluster_disk_nodes" do
it "overrides and sorts cluster_disk_nodes" do
expect(@chef_run.node['rabbitmq']['cluster_disk_nodes']).to eql(
["guest@host1", "guest@host2"]
)

View File

@ -19,8 +19,8 @@ def ops_messaging_stubs
::Chef::Recipe.any_instance.stub(:search).
with(:node, "roles:os-ops-messaging AND chef_environment:_default").
and_return [
{ 'hostname' => 'host1' },
{ 'hostname' => 'host2' }
{ 'hostname' => 'host2' },
{ 'hostname' => 'host1' }
]
::Chef::Recipe.any_instance.stub(:user_password).
and_return "rabbit-pass"