diff --git a/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/compute-capacity/compute-capacity.component.ts b/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/compute-capacity/compute-capacity.component.ts index b1b9ed27f..e6f031151 100644 --- a/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/compute-capacity/compute-capacity.component.ts +++ b/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/compute-capacity/compute-capacity.component.ts @@ -267,8 +267,8 @@ export class ComputeCapacityComponent implements OnInit { } else { const cpuLimitValue = this.form.get('cpuLimit').value; const memoryLimitValue = this.form.get('memoryLimit').value; - - results['computeResource'] = this.selectedName; + results['computeResource'] = this.selectedId; + results['computeResourceName'] = this.selectedName; results['cpu'] = unlimitedPattern.test(cpuLimitValue) ? '0' : cpuLimitValue; results['memory'] = unlimitedPattern.test(memoryLimitValue) ? '0' : memoryLimitValue; if (this.inAdvancedMode) { diff --git a/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/create-vch-wizard.service.ts b/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/create-vch-wizard.service.ts index 94be6a3c3..267efcdfd 100644 --- a/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/create-vch-wizard.service.ts +++ b/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/create-vch-wizard.service.ts @@ -196,6 +196,9 @@ export class CreateVchWizardService { * @returns {Observable} */ getResourcesCompleteInfo(basicInfoList: ResourceBasicInfo[]): Observable { + if (!basicInfoList) { + return Observable.of([]); + } const infoListObs: Observable[] = basicInfoList .map(resourceBasicInfo => { return this.getResourceCompleteInfo(resourceBasicInfo) diff --git a/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/summary/summary.component.ts b/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/summary/summary.component.ts index 6b635652a..99c11f2dd 100644 --- a/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/summary/summary.component.ts +++ b/h5c/vic/src/vic-webapp/src/app/create-vch-wizard/summary/summary.component.ts @@ -141,10 +141,16 @@ export class SummaryComponent implements OnInit { } for (const key in payload[section]) { + if (key === 'computeResource') {// computeResource is a id which is not needed in commandline. + continue; + } if (!(payload[section][key]) || payload[section][key] === '0') { continue; } - const newKey = key.replace(camelCasePattern, '$1-$2').toLowerCase(); + let newKey = key.replace(camelCasePattern, '$1-$2').toLowerCase(); + if (newKey === 'compute-resource-name') { + newKey = 'compute-resource'; // use computeResource in commandline. + } let value = payload[section][key]; if (typeof value === 'string') { value = this.escapeSpecialCharsForCLI(value);