Skip to content

Commit

Permalink
SNS all step message toggle and error subject changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kewlkiev committed May 25, 2016
1 parent ac9740e commit b2c9298
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions dataduct/etl/etl_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def create_base_objects(self):
else:
self.sns = self.create_pipeline_object(
object_class=SNSAlarm,
topic_arn=self.topic_arn,
topic_arn=self.topic_arn.replace('all:',''),
pipeline_name=self.name,
)
if self.frequency == 'on-demand':
Expand Down Expand Up @@ -481,10 +481,12 @@ def create_steps(self, steps_params, is_bootstrap=False,
'input_path' not in step_param:
step_param['input_node'] = input_node

# if is_teardown:
## Instead of just teardown set sns for every step so as to get SNS alerts with error stack trace
if hasattr(self.sns,'fields'):
step_param['sns_object'] = self.sns
if self.topic_arn.startswith("all:"):
## Instead of just teardown set sns for every step so as to get SNS alerts with error stack trace
step_param['sns_object'] = self.sns
elif is_teardown:
step_param['sns_object'] = self.sns

try:
step_class = step_param.pop('step_class')
Expand Down
2 changes: 1 addition & 1 deletion dataduct/pipeline/sns_alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self,
'Error Stack Trace: #{node.errorStackTrace}'
])

subject = 'Data Pipeline %s failed' % pipeline_name
subject = 'Data Pipeline %s #{node.@status}' % pipeline_name

if topic_arn is None:
topic_arn = SNS_TOPIC_ARN_FAILURE
Expand Down

0 comments on commit b2c9298

Please sign in to comment.