Skip to content

Commit

Permalink
fix style and remove duplicate properties
Browse files Browse the repository at this point in the history
  • Loading branch information
vgmartinez committed May 25, 2016
1 parent 8c36e47 commit 765c6b9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 73 deletions.
61 changes: 4 additions & 57 deletions conf/zeppelin-site.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -231,69 +231,16 @@
<description>Size in characters of the maximum text message to be received by websocket. Defaults to 1024000</description>
</property>

<!--
<property>
<name>zeppelin.mail.smtp.user</name>
<value>[email protected]</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.password</name>
<value>crucero1989</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.host</name>
<value>smtp.googlemail.com</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.protocol</name>
<value>smtp</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.port</name>
<value>465</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.starttls.enable</name>
<value>true</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.auth</name>
<value>true</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.socketFactory.port</name>
<value>465</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.socketFactory.class</name>
<value>javax.net.ssl.SSLSocketFactory</value>
<description>Anonymous user allowed by default</description>
</property>

<property>
<name>zeppelin.mail.smtp.user</name>
<value>[email protected]</value>
<value>email</value>
<description>SMTP user</description>
</property>
<property>
<name>zeppelin.mail.smtp.password</name>
<value>crucero1989</value>
<value>password</value>
<description>Password for SMTP user</description>
</property>
Expand Down Expand Up @@ -338,6 +285,6 @@
<value>javax.net.ssl.SSLSocketFactory</value>
<description>Specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets.</description>
</property>

-->
</configuration>

12 changes: 6 additions & 6 deletions zeppelin-web/src/components/scheduler/scheduler-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ <h4 class="modal-title">Scheduler note</h4>
Enter a addresses to email when a run starts, success, or encounters an error.
<br><br>
<div class="form-group">
<label class="control-label col-sm-2">On start</label>
<div class="col-sm-10">
<label class="control-label col-sm-3">On start</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="startEmail" ng-model="note.config.email.start"
placeholder="Emails (comma-separated)">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">On success</label>
<div class="col-sm-10">
<label class="control-label col-sm-3">On success</label>
<div class="col-sm-8">
<input type="text"class="form-control" id="successEmail" ng-model="note.config.email.success"
placeholder="Emails (comma-separated)">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">On error</label>
<div class="col-sm-10">
<label class="control-label col-sm-3">On error</label>
<div class="col-sm-8">
<input type="text"class="form-control" id="errorEmail" ng-model="note.config.email.error"
placeholder="Emails (comma-separated)">
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ public static enum ConfVars {
ZEPPELIN_ALLOWED_ORIGINS("zeppelin.server.allowed.origins", "*"),
ZEPPELIN_ANONYMOUS_ALLOWED("zeppelin.anonymous.allowed", true),
ZEPPELIN_WEBSOCKET_MAX_TEXT_MESSAGE_SIZE("zeppelin.websocket.max.text.message.size", "1024000"),
ZEPPELIN_SMTP_USER("zeppelin.mail.smtp.user", "[email protected]"),
ZEPPELIN_SMTP_PASS("zeppelin.mail.smtp.password", "crucero1989"),
ZEPPELIN_SMTP_USER("zeppelin.mail.smtp.user", "email"),
ZEPPELIN_SMTP_PASS("zeppelin.mail.smtp.password", "password"),
ZEPPELIN_SMTP_HOST("zeppelin.mail.smtp.host", "smtp.googlemail.com"),
ZEPPELIN_SMTP_PROTOCOL("zeppelin.mail.smtp.protocol", "smtp"),
ZEPPELIN_SMTP_PORT("zeppelin.mail.smtp.port", "465"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,17 +514,27 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
while (!note.getLastParagraph().isTerminated()) {
try {
Thread.sleep(1000);
for (Paragraph para : note.paragraphs) {
if (para.getStatus().isError()) {
//improve mail messages
String msg = "Error in paragraphs ";
if (para.getTitle() != null) {
msg = msg + para.getTitle() + "\n"
+ para.getResult().message();

} else {
msg = msg + para.getId() + "\n"
+ para.getResult().message();
}
//send error email
sendEmail(onError, msg);
}
}
} catch (InterruptedException e) {
logger.error(e.toString(), e);
}
}

for (Paragraph para : note.paragraphs) {
if (para.getStatus().isError()) {
//send email
sendEmail(onError, para.getStatus() + "\n" + para.text);
}
}

//send email when finish
sendEmail(onSuccess, "Note " + note.getName() + " has finish.");

Expand Down Expand Up @@ -581,7 +591,7 @@ public static void sendEmail(String email, String text) {
sessionEmail.send();

} catch (EmailException e) {
e.printStackTrace();
logger.error("Error: ", e);
}
}

Expand Down

0 comments on commit 765c6b9

Please sign in to comment.