Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use structured-facts for array values instead of joining them by , #120

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/facter/gluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,28 @@
if peer_count > 0
Facter.add(:gluster_peer_list) do
setcode do
peer_list
peer_list.sort
end
end

unless volume_bricks.empty?
Facter.add(:gluster_volume_list) do
setcode do
volume_bricks.keys
volume_bricks.keys.sort
end
end
volume_bricks.each do |vol, bricks|
Facter.add("gluster_volume_#{vol}_bricks".to_sym) do
setcode do
bricks
bricks.sort
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having read a bit more, I'm not actually sure this is the correct thing to do. Brick order is important?
See #121 (comment)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. After a short look to the documentation I'd say the brick order is important for stripped and distributed volumes. So it looks like #121 isn't a bug in this module but in the puppet configuration of the author of #121.

end
end
end
if volume_options
volume_options.each do |vol, opts|
Facter.add("gluster_volume_#{vol}_options".to_sym) do
setcode do
opts
opts.sort
end
end
end
Expand All @@ -91,7 +91,7 @@
volume_ports.each do |vol, ports|
Facter.add("gluster_volume_#{vol}_ports".to_sym) do
setcode do
ports
ports.sort
end
end
end
Expand Down