Dmytro Sen created AMBARI-17146:
-----------------------------------

             Summary: Implement config values trimming for deployment via 
blueprint
                 Key: AMBARI-17146
                 URL: https://issues.apache.org/jira/browse/AMBARI-17146
             Project: Ambari
          Issue Type: Task
    Affects Versions: 2.4.0
            Reporter: Dmytro Sen
            Assignee: Dmytro Sen
            Priority: Critical
             Fix For: 2.4.0


Implement config values trimming for deployment via blueprint as we do in UI
{code}
  trimProperty: function (property) {
    var displayType = Em.get(property, 'displayType');
    var value = Em.get(property, 'value');
    var name = Em.get(property, 'name');
    var rez;
    switch (displayType) {
      case 'directories':
      case 'directory':
        rez = value.replace(/,/g, ' ').trim().split(/\s+/g).join(',');
        break;
      case 'host':
        rez = value.trim();
        break;
      case 'password':
        break;
      default:
        if (name == 'javax.jdo.option.ConnectionURL' || name == 
'oozie.service.JPAService.jdbc.url') {
          rez = value.trim();
        }
        rez = (typeof value == 'string') ? value.replace(/(\s+$)/g, '') : value;
    }
    return ((rez == '') || (rez == undefined)) ? value : rez;
  },

{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to