From 71c50c71acfb53ce0986d71b72ec83b9f336080d Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Wed, 17 May 2017 16:28:22 -0400 Subject: [PATCH] Check for vim account selection before instantiating- display error and prevent user from continuing Signed-off-by: Laurence Maultsby --- .../plugins/launchpad/src/instantiate/instantiateStore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js index 0e91ee384..b673e3a18 100644 --- a/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js +++ b/skyquake/plugins/launchpad/src/instantiate/instantiateStore.js @@ -140,7 +140,7 @@ class LaunchNetworkServiceStore { Alt.actions.global.showNotification.defer({type: 'warning', msg: 'One or more VIM accounts have failed to connect'}); } if(cloudAccounts && cloudAccounts.length > 0) { - newState.selectedCloudAccount = cloudAccounts[0]; + newState.selectedCloudAccount = newState.cloudAccounts[0]; if (cloudAccounts[0]['account-type'] == 'openstack') { newState.displayPlacementGroups = true; } else { @@ -707,6 +707,10 @@ class LaunchNetworkServiceStore { if (this.state.ro && this.state.ro['account-type'] == 'openmano') { payload['om-datacenter'] = this.state.dataCenterID; } else { + if(!this.state.selectedCloudAccount) { + Alt.actions.global.showNotification.defer("No VIM Account Selected"); + return; + } payload["cloud-account"] = this.state.selectedCloudAccount.name; } if (this.state.hasConfigureNSD) { -- 2.25.1