summaryrefslogtreecommitdiff
path: root/lib/chef/run_context.rb
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2016-07-28 16:11:42 -0700
committerNoah Kantrowitz <noah@coderanger.net>2016-07-28 16:11:42 -0700
commit259be7a0cb3f7d7f7ee4d0f49211ddc8d9dcc1b9 (patch)
treec6115556aaf83776f0be580eae8966eb0c0ddbc9 /lib/chef/run_context.rb
parente2559fdd77256fa5ae350b52c77d893ff471d422 (diff)
downloadchef-259be7a0cb3f7d7f7ee4d0f49211ddc8d9dcc1b9.tar.gz
Remove some (hopefully) vestigial code related to notification storage.
John K and I are 99% sure those branches have never been used outside of unit tests. Fingers crossed!
Diffstat (limited to 'lib/chef/run_context.rb')
-rw-r--r--lib/chef/run_context.rb48
1 files changed, 6 insertions, 42 deletions
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb
index 29c936a932..89247d46bb 100644
--- a/lib/chef/run_context.rb
+++ b/lib/chef/run_context.rb
@@ -194,12 +194,7 @@ class Chef
# @param [Chef::Resource::Notification] The notification to add.
#
def notifies_before(notification)
- nr = notification.notifying_resource
- if nr.instance_of?(Chef::Resource)
- before_notification_collection[nr.name] << notification
- else
- before_notification_collection[nr.declared_key] << notification
- end
+ before_notification_collection[notification.notifying_resource.declared_key] << notification
end
#
@@ -208,12 +203,7 @@ class Chef
# @param [Chef::Resource::Notification] The notification to add.
#
def notifies_immediately(notification)
- nr = notification.notifying_resource
- if nr.instance_of?(Chef::Resource)
- immediate_notification_collection[nr.name] << notification
- else
- immediate_notification_collection[nr.declared_key] << notification
- end
+ immediate_notification_collection[notification.notifying_resource.declared_key] << notification
end
#
@@ -222,12 +212,7 @@ class Chef
# @param [Chef::Resource::Notification] The notification to add.
#
def notifies_delayed(notification)
- nr = notification.notifying_resource
- if nr.instance_of?(Chef::Resource)
- delayed_notification_collection[nr.name] << notification
- else
- delayed_notification_collection[nr.declared_key] << notification
- end
+ delayed_notification_collection[notification.notifying_resource.declared_key] << notification
end
#
@@ -245,50 +230,29 @@ class Chef
#
# Get the list of before notifications sent by the given resource.
#
- # TODO seriously, this is actually wrong. resource.name is not unique,
- # you need the type as well.
- #
# @return [Array[Notification]]
#
def before_notifications(resource)
- if resource.instance_of?(Chef::Resource)
- return before_notification_collection[resource.name]
- else
- return before_notification_collection[resource.declared_key]
- end
+ return before_notification_collection[resource.declared_key]
end
#
# Get the list of immediate notifications sent by the given resource.
#
- # TODO seriously, this is actually wrong. resource.name is not unique,
- # you need the type as well.
- #
# @return [Array[Notification]]
#
def immediate_notifications(resource)
- if resource.instance_of?(Chef::Resource)
- return immediate_notification_collection[resource.name]
- else
- return immediate_notification_collection[resource.declared_key]
- end
+ return immediate_notification_collection[resource.declared_key]
end
#
# Get the list of delayed (end of run) notifications sent by the given
# resource.
#
- # TODO seriously, this is actually wrong. resource.name is not unique,
- # you need the type as well.
- #
# @return [Array[Notification]]
#
def delayed_notifications(resource)
- if resource.instance_of?(Chef::Resource)
- return delayed_notification_collection[resource.name]
- else
- return delayed_notification_collection[resource.declared_key]
- end
+ return delayed_notification_collection[resource.declared_key]
end
#