summaryrefslogtreecommitdiff
path: root/lib/chef/node.rb
diff options
context:
space:
mode:
authorDavid Bresson <dabresson@gmail.com>2015-07-08 18:59:07 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-24 17:57:31 -0700
commit848b629b86e1394a76cab67d97e3a57925afa3b7 (patch)
tree752aecf3191114d7bf142b51a411f2df1657e39b /lib/chef/node.rb
parent44f9cd3842b6b6e0ac0a823f7ab311db91441a78 (diff)
downloadchef-848b629b86e1394a76cab67d97e3a57925afa3b7.tar.gz
Define == for node objects
Diffstat (limited to 'lib/chef/node.rb')
-rw-r--r--lib/chef/node.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index ad065cc02b..83ec7e2550 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -647,6 +647,14 @@ class Chef
"node[#{name}]"
end
+ def ==(other)
+ if other.kind_of?(self.class)
+ self.name == other.name
+ else
+ false
+ end
+ end
+
def <=>(other_node)
self.name <=> other_node.name
end