You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2015/05/09 01:12:11 UTC

ambari git commit: AMBARI-11026. Alerts: do not expose subject + body for SNMP traps (akovalenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 23f41d8a7 -> 0f4aea149


AMBARI-11026. Alerts: do not expose subject + body for SNMP traps (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0f4aea14
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0f4aea14
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0f4aea14

Branch: refs/heads/trunk
Commit: 0f4aea1491bf239eb7a135e779274b8b6826f253
Parents: 23f41d8
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Fri May 8 21:18:46 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Sat May 9 02:11:44 2015 +0300

----------------------------------------------------------------------
 .../manage_alert_notifications_controller.js    | 16 ++------------
 ambari-web/app/messages.js                      |  4 +---
 .../main/alerts/create_alert_notification.hbs   | 14 -------------
 ...anage_alert_notifications_controller_test.js | 22 --------------------
 4 files changed, 3 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f4aea14/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
index 19d2f9e..ba51dfa 100644
--- a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
+++ b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
@@ -126,16 +126,6 @@ App.ManageAlertNotificationsController = Em.Controller.extend({
       value: '',
       defaultValue: ''
     },
-    OIDSubject: {
-      label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.OIDSubject'),
-      value: '',
-      defaultValue: ''
-    },
-    OIDBody: {
-      label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.OIDBody'),
-      value: '',
-      defaultValue: ''
-    },
     community: {
       label: Em.I18n.t('alerts.actions.manage_alert_notifications_popup.community'),
       value: '',
@@ -346,8 +336,6 @@ App.ManageAlertNotificationsController = Em.Controller.extend({
     inputFields.set('emailFrom.value', selectedAlertNotification.get('properties')['mail.smtp.from']);
     inputFields.set('version.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.version']);
     inputFields.set('OIDs.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.trap']);
-    inputFields.set('OIDSubject.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.subject']);
-    inputFields.set('OIDBody.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.oids.body']);
     inputFields.set('community.value', selectedAlertNotification.get('properties')['ambari.dispatch.snmp.community']);
     inputFields.set('host.value', selectedAlertNotification.get('properties')['ambari.dispatch.recipients'] ?
       selectedAlertNotification.get('properties')['ambari.dispatch.recipients'].join(', ') : '');
@@ -665,8 +653,8 @@ App.ManageAlertNotificationsController = Em.Controller.extend({
     } else {
       properties['ambari.dispatch.snmp.version'] = inputFields.get('version.value');
       properties['ambari.dispatch.snmp.oids.trap'] = inputFields.get('OIDs.value');
-      properties['ambari.dispatch.snmp.oids.subject'] = inputFields.get('OIDSubject.value');
-      properties['ambari.dispatch.snmp.oids.body'] = inputFields.get('OIDBody.value');
+      properties['ambari.dispatch.snmp.oids.subject'] = inputFields.get('OIDs.value');
+      properties['ambari.dispatch.snmp.oids.body'] = inputFields.get('OIDs.value');
       properties['ambari.dispatch.snmp.community'] = inputFields.get('community.value');
       properties['ambari.dispatch.recipients'] = inputFields.get('host.value').replace(/\s/g, '').split(',');
       properties['ambari.dispatch.snmp.port'] = inputFields.get('port.value');

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f4aea14/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9471388..2cf9615 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2028,9 +2028,7 @@ Em.I18n.translations = {
   'alerts.actions.manage_alert_notifications_popup.SMTPSTARTTLS':'Start TLS',
   'alerts.actions.manage_alert_notifications_popup.emailFrom':'Email From',
   'alerts.actions.manage_alert_notifications_popup.version':'Version',
-  'alerts.actions.manage_alert_notifications_popup.OIDs':'OIDs',
-  'alerts.actions.manage_alert_notifications_popup.OIDSubject':'OID Subject',
-  'alerts.actions.manage_alert_notifications_popup.OIDBody':'OID Body',
+  'alerts.actions.manage_alert_notifications_popup.OIDs':'OID',
   'alerts.actions.manage_alert_notifications_popup.community':'Community',
   'alerts.actions.manage_alert_notifications_popup.host':'Hosts',
   'alerts.actions.manage_alert_notifications_popup.port':'Port',

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f4aea14/ambari-web/app/templates/main/alerts/create_alert_notification.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/alerts/create_alert_notification.hbs b/ambari-web/app/templates/main/alerts/create_alert_notification.hbs
index e38d216..647ba98 100644
--- a/ambari-web/app/templates/main/alerts/create_alert_notification.hbs
+++ b/ambari-web/app/templates/main/alerts/create_alert_notification.hbs
@@ -200,20 +200,6 @@
             {{view Em.TextField valueBinding="controller.inputFields.OIDs.value" class="input-xlarge"}}
           </div>
       </div>
-      <div class="control-group">
-          <label class="control-label">{{controller.inputFields.OIDSubject.label}}</label>
-
-          <div class="controls">
-            {{view Em.TextField valueBinding="controller.inputFields.OIDSubject.value" class="input-xlarge"}}
-          </div>
-      </div>
-      <div class="control-group">
-          <label class="control-label">{{controller.inputFields.OIDBody.label}}</label>
-
-          <div class="controls">
-            {{view Em.TextField valueBinding="controller.inputFields.OIDBody.value" class="input-xlarge"}}
-          </div>
-      </div>
 
       <div class="control-group">
         <label class="control-label">{{controller.inputFields.community.label}}</label>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f4aea14/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
index a74839b..6c48b64 100644
--- a/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
+++ b/ambari-web/test/controllers/main/alerts/manage_alert_notifications_controller_test.js
@@ -249,12 +249,6 @@ describe('App.ManageAlertNotificationsController', function () {
         OIDs: {
           value: ''
         },
-        OIDSubject: {
-          value: ''
-        },
-        OIDBody: {
-          value: ''
-        },
         community: {
           value: ''
         },
@@ -324,8 +318,6 @@ describe('App.ManageAlertNotificationsController', function () {
         },
         version: {},
         OIDs: {},
-        OIDSubject: {},
-        OIDBody: {},
         community: {},
         host: {
           value: 'test1@test.test, test2@test.test'
@@ -355,8 +347,6 @@ describe('App.ManageAlertNotificationsController', function () {
           'customName': 'customValue',
           'ambari.dispatch.snmp.version': 'SNMPv1',
           'ambari.dispatch.snmp.oids.trap': '1',
-          'ambari.dispatch.snmp.oids.subject': 'OID Subject',
-          'ambari.dispatch.snmp.oids.body': 'OID Body',
           'ambari.dispatch.snmp.community': 'snmp',
           'ambari.dispatch.snmp.port': 161
 
@@ -418,12 +408,6 @@ describe('App.ManageAlertNotificationsController', function () {
         OIDs: {
           value: ''
         },
-        OIDSubject: {
-          value: ''
-        },
-        OIDBody: {
-          value: ''
-        },
         community: {
           value: ''
         },
@@ -485,12 +469,6 @@ describe('App.ManageAlertNotificationsController', function () {
         OIDs: {
           value: '1'
         },
-        OIDSubject: {
-          value: 'OID Subject'
-        },
-        OIDBody: {
-          value:'OID Body'
-        },
         community: {
           value: 'snmp'
         },