You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by gn...@apache.org on 2017/02/24 17:14:42 UTC
ambari git commit: AMBARI-20167. importing from workflow from the
coordinator setup hangs. (Madhan Mohan Reddy via gauravn7)
Repository: ambari
Updated Branches:
refs/heads/branch-2.5 bffd2644c -> 65888b0a9
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/65888b0a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/65888b0a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/65888b0a
Branch: refs/heads/branch-2.5
Commit: 65888b0a9cc7f0cc77a243089af97cbefdd3f18c
Parents: bffd264
Author: Gaurav Nagar <gr...@gmail.com>
Authored: Fri Feb 24 22:44:09 2017 +0530
Committer: Gaurav Nagar <gr...@gmail.com>
Committed: Fri Feb 24 22:44:09 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/65888b0a/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/65888b0a/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"}}
<span class="input-group-btn">
<button class="btn btn-secondary" type="button" {{action "openFileBrowser" "coordinator.workflow.appPath"}}>Browse</button>
- <button class="btn btn-default" type="button" {{action "openTab" 'wf' coordinator.workflow.appPath}} name="button"><i class="fa fa-external-link"></i></button>
+ <button class="btn btn-default" type="button" disabled={{containsParameteriedPaths}} title={{parameterizedPathWarning}} {{action "openTab" 'wf' coordinator.workflow.appPath}} name="button"><i class="fa fa-external-link"></i></button>
</span>
</div>
{{#if workflowName}}