瀏覽代碼

HUE-5119 [oozie] Email result on batch completion

Romain Rigaux 9 年之前
父節點
當前提交
1824832bad

+ 9 - 1
apps/oozie/src/oozie/models2.py

@@ -851,7 +851,7 @@ class Node():
       'workflow_mapping': workflow_mapping
     }
 
-    if mapping.get('email_checkbox'):
+    if mapping.get('send_email'):
       if self.data['type'] == KillAction.TYPE and not self.data['properties'].get('enableMail'):
         self.data['properties']['enableMail'] = True
         self.data['properties']['to'] = self.user.email
@@ -863,6 +863,14 @@ class Node():
         self.data['properties']['to'] = self.user.email
         self.data['properties']['subject'] = _("${wf:name()} execution successful")
 
+        if mapping.get('send_result') or True:
+          if self.data['type'] == HiveDocumentAction.TYPE:
+            # Convert SELECT to insert
+            # Add attachment loc
+            pass
+        # If send report link
+        # Convert query to create table if not exist and insert partition
+
     return django_mako.render_to_string(self.get_template_name(), data)
 
   @property

+ 2 - 2
apps/oozie/src/oozie/templates/editor2/submit_job_popup.mako

@@ -76,7 +76,7 @@
 
       % if show_dryrun:
          <label class="checkbox" style="display: inline-block; margin-top: 5px">
-           <input type="checkbox" name="dryrun_checkbox" /> ${ _('Do a dryrun before submitting the job?') }
+           <input type="checkbox" name="dryrun_checkbox" /> ${ _('Do a dryrun before submitting the job') }
          </label>
       % endif
       % if is_oozie_mail_enabled:
@@ -88,7 +88,7 @@
           % endif
           />
         % if email_id:
-          ${_('Email notification to ')}<a href="/useradmin/users/edit/${user.username}#step2" target="_blank"> ${email_id} </a>
+          ${_('Send completion email to ')}<a href="/useradmin/users/edit/${user.username}#step2" target="_blank"> ${email_id} </a>
         % else:
           ${_('Email not set in ')}<a href="/useradmin/users/edit/${user.username}#step2" target="_blank"> ${_('profile.')} </a>
         % endif

+ 1 - 1
apps/oozie/src/oozie/views/editor2.py

@@ -398,7 +398,7 @@ def _submit_workflow_helper(request, workflow, submit_action):
     if params_form.is_valid():
       mapping = dict([(param['name'], param['value']) for param in params_form.cleaned_data])
       mapping['dryrun'] = request.POST.get('dryrun_checkbox') == 'on'
-      mapping['email_checkbox'] = request.POST.get('email_checkbox') == 'on'
+      mapping['send_email'] = request.POST.get('email_checkbox') == 'on'
       if '/submit_single_action/' in submit_action:
         mapping['submit_single_action'] = True