Skip to content

Commit

Permalink
Merge pull request #303 from dpeters/sort_properties
Browse files Browse the repository at this point in the history
Sort array properties before comparison
  • Loading branch information
jlambert121 committed Jan 27, 2015
2 parents 6e1f607 + cb9de52 commit 1a76727
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/puppet/type/sensu_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ def initialize(*args)

newproperty(:dependencies, :array_matching => :all) do
desc "Dependencies of this check"
def insync?(is)
is.sort == should.sort
end
end

newproperty(:handlers, :array_matching => :all) do
desc "List of handlers that responds to this check"
def insync?(is)
is.sort == should.sort
end
end

newproperty(:high_flap_threshold) do
Expand Down Expand Up @@ -71,6 +77,9 @@ def initialize(*args)

newproperty(:subscribers, :array_matching => :all) do
desc "Who is subscribed to this check"
def insync?(is)
is.sort == should.sort
end
end

newproperty(:custom) do
Expand Down
3 changes: 3 additions & 0 deletions lib/puppet/type/sensu_client_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def initialize(*args)

newproperty(:subscriptions, :array_matching => :all) do
desc ""
def insync?(is)
is.sort == should.sort
end
end

newproperty(:bind) do
Expand Down
9 changes: 9 additions & 0 deletions lib/puppet/type/sensu_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,23 @@ def insync?(is)

newproperty(:filters, :array_matching => :all) do
desc "Handler filters"
def insync?(is)
is.sort == should.sort
end
end

newproperty(:severities, :array_matching => :all) do
desc "Severities applicable to this handler"
def insync?(is)
is.sort == should.sort
end
end

newproperty(:handlers, :array_matching => :all) do
desc "Handlers this handler mutexes into"
def insync?(is)
is.sort == should.sort
end
end

newproperty(:config) do
Expand Down

0 comments on commit 1a76727

Please sign in to comment.