Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0C6B9200C25 for ; Fri, 24 Feb 2017 18:15:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0AFDB160B69; Fri, 24 Feb 2017 17:15:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 52E56160B62 for ; Fri, 24 Feb 2017 18:15:38 +0100 (CET) Received: (qmail 91464 invoked by uid 500); 24 Feb 2017 17:15:37 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 91455 invoked by uid 99); 24 Feb 2017 17:15:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2017 17:15:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 64648DFC1C; Fri, 24 Feb 2017 17:15:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gnagar@apache.org To: commits@ambari.apache.org Message-Id: <9faf529516e44a6e974e6985089c0375@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-20167. importing from workflow from the coordinator setup hangs. (Madhan Mohan Reddy via gauravn7) Date: Fri, 24 Feb 2017 17:15:37 +0000 (UTC) archived-at: Fri, 24 Feb 2017 17:15:39 -0000 Repository: ambari Updated Branches: refs/heads/trunk 378a49e33 -> f3877c132 AMBARI-20167. importing from workflow from the coordinator setup hangs. (Madhan Mohan Reddy via gauravn7) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f3877c13 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f3877c13 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f3877c13 Branch: refs/heads/trunk Commit: f3877c13200e9f8000fe70d0b799112e205715bc Parents: 378a49e Author: Gaurav Nagar Authored: Fri Feb 24 22:44:09 2017 +0530 Committer: Gaurav Nagar Committed: Fri Feb 24 22:45:30 2017 +0530 ---------------------------------------------------------------------- .../resources/ui/app/components/coord-config.js | 26 +++++++++++++++++--- .../app/templates/components/coord-config.hbs | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f3877c13/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js index 4a57e37..61d9f35 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js @@ -593,7 +593,16 @@ export default Ember.Component.extend(Validations, Ember.Evented, { }); }, openTab(type, path){ - this.sendAction('openTab', type, path); + this.set('errorMsg', ''); + var path = this.appendFileName(path, type); + var deferred = this.readFromHdfs(path); + deferred.promise.then(function(data){ + this.sendAction('openTab', type, path); + }.bind(this)).catch(function(data){ + console.log(data); + this.set('errorMsg', 'There is some problem while importing.'); + this.set('data', data); + }.bind(this)); }, showParameterSettings(value){ if(this.get('coordinator.parameters') !== null){ @@ -636,15 +645,26 @@ export default Ember.Component.extend(Validations, Ember.Evented, { }, showWorkflowName(){ this.set('workflowName', null); + this.set('errorMsg', ""); var path = this.appendFileName(this.get('coordinator.workflow.appPath'), 'wf'); + if (this.get('propertyExtractor').containsParameters(path)) { + this.set('containsParameteriedPaths', true); + this.set('parameterizedPathWarning', 'Workflow path contains variables'); + return; + } else { + this.set('containsParameteriedPaths', false); + this.set('parameterizedPathWarning', ''); + } var deferred = this.readFromHdfs(path); deferred.promise.then(function(data){ var x2js = new X2JS(); var workflowJson = x2js.xml_str2json(data); this.set('workflowName', workflowJson["workflow-app"]._name); - }.bind(this)).catch(function(e){ + }.bind(this)).catch(function(data){ + console.log(data); this.set('workflowName', null); - throw new Error(e); + this.set('errorMsg', "There is some problem while fetching workflow name."); + this.set("data", data); }.bind(this)); }, showVersionSettings(value){ http://git-wip-us.apache.org/repos/asf/ambari/blob/f3877c13/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs index 7db5ce2..0e35d0e 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs @@ -106,7 +106,7 @@ {{input type="text" class="form-control" name="appPath" focus-out="showWorkflowName" value=coordinator.workflow.appPath placeholder="Path of the workflow file"}} - + {{#if workflowName}}