Unverified Commit 2906315c authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

quick fix http error (#1896)

parent 8d8c9de4
...@@ -62,13 +62,13 @@ class PAIK8STrainingService extends PAITrainingService { ...@@ -62,13 +62,13 @@ class PAIK8STrainingService extends PAITrainingService {
case TrialConfigMetadataKey.PAI_CLUSTER_CONFIG: case TrialConfigMetadataKey.PAI_CLUSTER_CONFIG:
this.paiJobRestServer = new PAIJobRestServer(component.get(PAIK8STrainingService)); this.paiJobRestServer = new PAIJobRestServer(component.get(PAIK8STrainingService));
this.paiClusterConfig = <PAIClusterConfig>JSON.parse(value); this.paiClusterConfig = <PAIClusterConfig>JSON.parse(value);
this.paiClusterConfig.host = this.formatPAIHost(this.paiClusterConfig.host);
if(this.paiClusterConfig.passWord) { if(this.paiClusterConfig.passWord) {
// Get PAI authentication token // Get PAI authentication token
await this.updatePaiToken(); await this.updatePaiToken();
} else if(this.paiClusterConfig.token) { } else if(this.paiClusterConfig.token) {
this.paiToken = this.paiClusterConfig.token; this.paiToken = this.paiClusterConfig.token;
} }
this.paiClusterConfig.host = this.formatPAIHost(this.paiClusterConfig.host);
break; break;
case TrialConfigMetadataKey.TRIAL_CONFIG: case TrialConfigMetadataKey.TRIAL_CONFIG:
......
...@@ -99,6 +99,7 @@ class PAIYarnTrainingService extends PAITrainingService { ...@@ -99,6 +99,7 @@ class PAIYarnTrainingService extends PAITrainingService {
path: '/webhdfs/api/v1', path: '/webhdfs/api/v1',
host: this.paiClusterConfig.host host: this.paiClusterConfig.host
}); });
this.paiClusterConfig.host = this.formatPAIHost(this.paiClusterConfig.host);
if(this.paiClusterConfig.passWord) { if(this.paiClusterConfig.passWord) {
// Get PAI authentication token // Get PAI authentication token
await this.updatePaiToken(); await this.updatePaiToken();
...@@ -107,7 +108,6 @@ class PAIYarnTrainingService extends PAITrainingService { ...@@ -107,7 +108,6 @@ class PAIYarnTrainingService extends PAITrainingService {
} else { } else {
throw new Error('pai cluster config format error, please set password or token!'); throw new Error('pai cluster config format error, please set password or token!');
} }
this.paiClusterConfig.host = this.formatPAIHost(this.paiClusterConfig.host);
break; break;
case TrialConfigMetadataKey.TRIAL_CONFIG: case TrialConfigMetadataKey.TRIAL_CONFIG:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment