Skip to content

Commit

Permalink
a patch. Now the UX end to end works with the UNS verified to be send…
Browse files Browse the repository at this point in the history
…ing atleast the fake email.
  • Loading branch information
swarbhanu committed Dec 4, 2012
1 parent f6942e3 commit 4143efb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ion/processes/data/transforms/event_alert_transform.py
Expand Up @@ -6,6 +6,7 @@
@author Swarbhanu Chatterjee
'''
from pyon.util.log import log
from pyon.core.exception import NotFound
from pyon.util.containers import DotDict, get_ion_ts
from pyon.util.arg_check import validate_is_instance, validate_true
from pyon.event.event import EventPublisher, EventSubscriber
Expand Down Expand Up @@ -303,7 +304,15 @@ def execute(input=None, context=None, config=None, params=None, state=None):
valid_values = config.get_safe('valid_values', [-100,100])
variable_name = config.get_safe('variable_name', 'input_voltage')
preferred_time = config.get_safe('time_field_name', 'preferred_timestamp')
origin = config.get_safe('origin', input.data_producer_id)

# Get the source of the granules which will be used to set the origin of the DeviceStatusEvent and DeviceCommsEvent events
origin = config.get_safe('origin')
if not origin:
origin = input.data_producer_id

if not origin:
raise NotFound("The DemoStreamAlertTransform could not figure out the origin. It needs to be provided an origin through a config for the DeviceStatus and DeviceCommsEvent events it will publish."
"If not, then the data_producer_id attribute should be filled for the granules that are sent to it so that it can figure out the origin to use.")

if origin != input.data_producer_id:
log.debug("Received an event of the correct type but the wrong source!")
Expand Down

0 comments on commit 4143efb

Please sign in to comment.