configurator: fix single vm scenario load issue
fix single vm scenario load issue
@@ -268,6 +268,17 @@ export class ProgramLayer extends EventBase {
let scenarioConfig = await this.xmlLayer.loadScenario(scenarioXMLPath)
this.initScenario()
this.scenarioData.hv = scenarioConfig.hv;
+ if (scenarioConfig.hasOwnProperty('vm')) {
+ if (!_.isArray(scenarioConfig.vm)) {
+ if (_.isObject(scenarioConfig.vm)) {
+ scenarioConfig.vm = [scenarioConfig.vm]
+ } else {
+ console.log(scenarioConfig.vm);
+ debugger;
+ this.onScenarioDataUpdateEvent()
+ return
+ }
+ }
scenarioConfig.vm.map((vmConfig, index) => {
let vmType = vmConfig.load_order
if (!this.scenarioData.vm.hasOwnProperty(vmType)) {
@@ -284,6 +295,7 @@ export class ProgramLayer extends EventBase {
this.addVM(vmType, vmConfig)
}
})
+ }
this.onScenarioDataUpdateEvent()
}
